3v4l.org

run code in 200+ PHP versions simultaneously
<?php for( $errors_count = 1; $errors_count < 5; $errors_count++ ) { echo 'Current code:'.PHP_EOL; var_dump( 'unknown_upgrade_error_' . $errors_count + 1 ); echo PHP_EOL.'Fixed code:'.PHP_EOL; var_dump( 'unknown_upgrade_error_' . ( $errors_count + 1 ) ); }
based on iNtUe
Output for 7.4.0 - 7.4.6
Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /in/EYuU8 on line 5 Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_2" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_3" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_4" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_5"
Output for 7.1.0 - 7.3.18
Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_2" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_3" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_4" Current code: Warning: A non-numeric value encountered in /in/EYuU8 on line 5 int(1) Fixed code: string(23) "unknown_upgrade_error_5"
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.0.33
Current code: int(1) Fixed code: string(23) "unknown_upgrade_error_2" Current code: int(1) Fixed code: string(23) "unknown_upgrade_error_3" Current code: int(1) Fixed code: string(23) "unknown_upgrade_error_4" Current code: int(1) Fixed code: string(23) "unknown_upgrade_error_5"
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 4 Current code:PHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 PHP_EOLFixed code:PHP_EOLstring(23) "unknown_upgrade_error_2" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 4 Current code:PHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 PHP_EOLFixed code:PHP_EOLstring(23) "unknown_upgrade_error_3" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 4 Current code:PHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 PHP_EOLFixed code:PHP_EOLstring(23) "unknown_upgrade_error_4" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 4 Current code:PHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/EYuU8 on line 7 PHP_EOLFixed code:PHP_EOLstring(23) "unknown_upgrade_error_5"