3v4l.org

run code in 500+ PHP versions simultaneously
<?php $x = 'a'; $b = 8; $c = 25; echo '1: '; echo (null ?? $x.'_1')."\n"; echo '2: '; echo ('notnull' ?? $x.'_1')."\n"; echo '3: '; echo ('notnull' ?? ($x.'_1'))."\n"; echo '4: '; echo ('notnull' ?? $b + 1)."\n"; echo '5: '; echo ('notnull' ?? $c > 1)."\n"; echo '6: '; echo ('notnull' ?? $b || $c)."\n"; echo ('7: '. 1 + $c ?? 2 + $b ?? 3); echo "\n"; echo '8: '. 1 + null ?? 2 + $b ?? 3; echo "\n";
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.31, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
1: a_1 2: notnull 3: notnull 4: notnull 5: notnull 6: notnull 7: 26 8: 1
Output for 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/GDaGm on line 13 Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/GDaGm on line 14 1: a_1 2: notnull 3: notnull 4: notnull 5: notnull 6: notnull Notice: A non well formed numeric value encountered in /in/GDaGm on line 13 32 Notice: A non well formed numeric value encountered in /in/GDaGm on line 14 8
Output for 7.3.32, 7.4.26
1: a_1 2: notnull 3: notnull 4: notnull 5: notnull 6: notnull 32 8
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.31, 7.3.33
1: a_1 2: notnull 3: notnull 4: notnull 5: notnull 6: notnull Notice: A non well formed numeric value encountered in /in/GDaGm on line 13 32 Notice: A non well formed numeric value encountered in /in/GDaGm on line 14 8

preferences:
86.29 ms | 1552 KiB | 4 Q