Skip to main content

PHP -r (891 680 674 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

< is echo Z^f; (9 bytes)
? is echo Z^e; (9 bytes)
= is echo Z^g; (9 bytes)


Score:

(7 * 90) + 8 + 9 + 9 + 9 + 9 = 674 bytes

PHP (891 680 674 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

< is echo Z^f; (9 bytes)
? is echo Z^e; (9 bytes)
= is echo Z^g; (9 bytes)


Score:

(7 * 90) + 8 + 9 + 9 + 9 + 9 = 674 bytes

PHP -r (891 680 674 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

< is echo Z^f; (9 bytes)
? is echo Z^e; (9 bytes)
= is echo Z^g; (9 bytes)


Score:

(7 * 90) + 8 + 9 + 9 + 9 + 9 = 674 bytes

Corrected byte count for -r flags
Source Link

PHP (891 688680 674 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
= is <?php echo Z^g; (15 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

php -r'echo< is echo Z^f;'Z^f; (139 bytes) 
php? is echo -r'echoZ^e; (9 bytes)
= is echo Z^e;'Z^g; (139 bytes)


Score:

(7 * 90) + 8 + 159 + 9 + 139 + 139 = 688674 bytes

PHP (891 688 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
= is <?php echo Z^g; (15 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

php -r'echo Z^f;' (13 bytes) php -r'echo Z^e;' (13 bytes)


Score:

(7 * 90) + 8 + 15 + 9 + 13 + 13 = 688 bytes

PHP (891 680 674 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego


This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

< is echo Z^f; (9 bytes) 
? is echo Z^e; (9 bytes)
= is echo Z^g; (9 bytes)


Score:

(7 * 90) + 8 + 9 + 9 + 9 + 9 = 674 bytes

Vast improvements
Source Link

PHP (891891 688 bytes, 22 0 DNP)

The standard case looks like this:

<?="\40";

This covers 17 characters at 9Edit: saved 203 bytes each,thanks to jimmy23013 and 62 characters at 10 bytes each (forimplemented the triple-digit characters).2 DNP thanks to Mego

 

Characters 0-9 are printed like thisThis answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (10 characters at 77 bytes each):

<?=1-1;
<?=3-2;
<?=1+1;=Y^x;
<?=1+2;=Z&e;
<?=1+3;
// and so on=V|Z;

Exceptions: PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, "Y^x becomes 89^78. The result of this is <?=chr(34);33, which is then sent to STDOUT as the character (11 bytes)
!.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?="\73"=Z^a?> (108 bytes)
= is <?php echo"\75";echo Z^g; (1615 bytes)
\| is <?=chr(92);='9'^E; (119 bytes)

...adding another 48 bytes.

< and ? are DNPwould normally be DNP due to the fact that <? is a required start tag in all PHP scripts., but by using the -r flag, code can be executed without them:

php -r'echo Z^f;' (13 bytes) php -r'echo Z^e;' (13 bytes)


TotalScore:

153(7 * 90) + 6208 + 7015 + 489 + 13 + 13 = 891688 bytes.

PHP (891 bytes, 2 DNP)

The standard case looks like this:

<?="\40";

This covers 17 characters at 9 bytes each, and 62 characters at 10 bytes each (for the triple-digit characters).

Characters 0-9 are printed like this (10 characters at 7 bytes each):

<?=1-1;
<?=3-2;
<?=1+1;
<?=1+2;
<?=1+3;
// and so on

Exceptions:

" is <?=chr(34); (11 bytes)
; is <?="\73"?> (10 bytes)
= is <?php echo"\75"; (16 bytes)
\ is <?=chr(92); (11 bytes)

...adding another 48 bytes.

< and ? are DNP due to the fact that <? is a required start tag in all PHP scripts.

Total:

153 + 620 + 70 + 48 = 891 bytes.

PHP (891 688 bytes, 2 0 DNP)

Edit: saved 203 bytes thanks to jimmy23013 and implemented the 2 DNP thanks to Mego

 

This answer heavily abuses PHP's generous nature. Most of the cases take one of these forms (7 bytes each):

<?=Y^x;
<?=Z&e;
<?=V|Z;

PHP converts the letters on either side of the operator to strings, then performs the appropriate bitwise operation by converting each string to its ASCII character value, and finally converts the result back to a character.

In the first example above, Y^x becomes 89^78. The result of this is 33, which is then sent to STDOUT as the character !.

A script was written to bruteforce all possible combinations: the results can be found here.


Exceptions:

; is <?=Z^a?> (8 bytes)
= is <?php echo Z^g; (15 bytes)
| is <?='9'^E; (9 bytes)

< and ? would normally be DNP due to the required start tag, but by using the -r flag, code can be executed without them:

php -r'echo Z^f;' (13 bytes) php -r'echo Z^e;' (13 bytes)


Score:

(7 * 90) + 8 + 15 + 9 + 13 + 13 = 688 bytes

Source Link
Loading