3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $path = "/var/www/foo"; var_dump($pаth."/user/supplied/path"); // prints /user/supplied/path, and emits a notice // let's write a secure random number generator function crypto_rnd() { $rnd = mt_rand(0, 1e30); // 3v4l apparently doesn't have openssl_random_pseudo_bytes $today = date('c'); // extra entropy can't hurt! return hash("sha512", $r⁠nd.$today); // oops, that's actually r\u2060nd, which is undefined, // i.e. NULL, and the result depends only on the current time... } var_dump(crypto_rnd() === crypto_rnd()); // bool(true)... uh oh $foo = 1; var_dump($foo === $foо); // bool(false)... $x = 2; var_dump($x+$⁠x); // int(2), what the everloving fuck
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Warning: mt_rand() expects parameter 2 to be integer, float given in /in/pdGTF on line 8 Notice: Undefined variable: r⁠nd in /in/pdGTF on line 10 Warning: mt_rand() expects parameter 2 to be integer, float given in /in/pdGTF on line 8 Notice: Undefined variable: r⁠nd in /in/pdGTF on line 10 bool(true) Notice: Undefined variable: foо in /in/pdGTF on line 16 bool(false) Notice: Undefined variable: ⁠x in /in/pdGTF on line 19 int(2)
Output for 5.1.2 - 5.6.28
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Notice: Undefined variable: r⁠nd in /in/pdGTF on line 10 Notice: Undefined variable: r⁠nd in /in/pdGTF on line 10 bool(true) Notice: Undefined variable: foо in /in/pdGTF on line 16 bool(false) Notice: Undefined variable: ⁠x in /in/pdGTF on line 19 int(2)
Output for 5.0.4 - 5.0.5, 5.1.1
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Fatal error: Call to undefined function hash() in /in/pdGTF on line 10
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/pdGTF on line 19
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Fatal error: Call to undefined function hash() in /in/pdGTF on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Fatal error: Call to undefined function: hash() in /in/pdGTF on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Fatal error: Call to undefined function: hash() in /in/pdGTF on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: pаth in /in/pdGTF on line 4 string(19) "/user/supplied/path" Fatal error: Call to undefined function: hash() in /in/pdGTF on line 10