Skip to main content
Commonmark migration
Source Link

#PHP, 15 bytes, 2 exit codes

PHP, 15 bytes, 2 exit codes

Without die/exit, PHP cannot return anything but 0 or 255 (afaik; probably ~1), so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p().

Run with -r.

#PHP, 15 bytes, 2 exit codes

Without die/exit, PHP cannot return anything but 0 or 255 (afaik; probably ~1), so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p().

Run with -r.

PHP, 15 bytes, 2 exit codes

Without die/exit, PHP cannot return anything but 0 or 255 (afaik; probably ~1), so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p().

Run with -r.

code 255, not 1
Source Link
Titus
  • 14.9k
  • 1
  • 25
  • 41

#PHP, 15 bytes, 2 exit codes

Without die/exit, PHP cannot return anything but 0 or 1255 (afaik; probably ~1), so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). 

Run with -r.

#PHP, 15 bytes, 2 exit codes

PHP cannot return anything but 0 or 1, so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). Run with -r.

#PHP, 15 bytes, 2 exit codes

Without die/exit, PHP cannot return anything but 0 or 255 (afaik; probably ~1), so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). 

Run with -r.

added 6 characters in body
Source Link
Addison Crump
  • 11.3k
  • 1
  • 45
  • 91

#PHP, 15 bytes/2 = 7.5, 2 exit codes

PHP cannot return anything but 0 or 1, so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). Run with -r.

#PHP, 15 bytes/2 = 7.5

PHP cannot return anything but 0 or 1, so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). Run with -r.

#PHP, 15 bytes, 2 exit codes

PHP cannot return anything but 0 or 1, so ...

!$argv[1]?:p(); 

If command line argument is falsy, it evaluates to 1 and exits with 0. If not, it tries to call a function and exits with <b>Fatal error</b>: Uncaught Error: Call to undefined function p(). Run with -r.

Source Link
Titus
  • 14.9k
  • 1
  • 25
  • 41
Loading