3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); // print() ignores strict_types... print (1 + 2) * 3; // outputs "9"; the parentheses cause 1+2 to be evaluated first, then 3*3 // the print statement sees the whole expression as one argument // As for the type mismatch? the strict_types ? ignored.. echo "\n"; if ( print("hello") and false ) { print "WTF: inside if"; } else { print "OK: inside else"; } echo "\n"; if ( 1 && false ) { print "WTF: inside if"; } else { print "OK: inside else"; } echo "\n"; print "hello " and print "world"; // outputs "world1"; ... WTF? echo "\n"; ob_start(); print "hello " and print "world"; $str = ob_get_clean(); assert(str_contains($str, 'hello'));
Output for git.master_jit, git.master
9 helloOK: inside else OK: inside else hello world

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
59.04 ms | 405 KiB | 5 Q