3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new class { function __destruct() { $GLOBALS['a'] = eval('$c=`ls`;return $b. 0x1B;') . "[42m 2>&1" ; } }; $a = `2`; var_dump($a);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: shell_exec(): Unable to execute '2' in /in/sfnZW on line 12 Warning: shell_exec(): Unable to execute 'ls' in /in/sfnZW(7) : eval()'d code on line 1 Warning: Undefined variable $b in /in/sfnZW(7) : eval()'d code on line 1 string(11) "27[42m 2>&1"
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31, 7.4.3 - 7.4.33
Warning: shell_exec(): Unable to execute '2' in /in/sfnZW on line 12 Warning: shell_exec(): Unable to execute 'ls' in /in/sfnZW(7) : eval()'d code on line 1 Notice: Undefined variable: b in /in/sfnZW(7) : eval()'d code on line 1 string(11) "27[42m 2>&1"
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1, 7.4.0
Notice: Undefined variable: b in /in/sfnZW(7) : eval()'d code on line 1 string(11) "27[42m 2>&1"
Output for 7.3.32 - 7.3.33
Warning: shell_exec(): Unable to execute '2' in /in/sfnZW on line 12 Warning: shell_exec(): Unable to execute 'ls' in /in/sfnZW(7) : eval()'d code on line 1 string(11) "27[42m 2>&1"

preferences:
182.89 ms | 401 KiB | 176 Q