3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "2017 MODEL YEAR 6.7L POWER STROKE V8 DIESEL 6-SPEED AUTO TRANS 3.55 ELECTRONIC LOCKING AXLE FX4 OFF-ROAD PACKAGE .SKID PLATES 10000-lb. GVWR 20000-lb PACKAGE"; Preg_match("/(\d+)(\d{3})-lb/ui", $string, $match); $find = $match[0]; $replace = $match[1] .",". $match[2] ."-lb"; Echo length($match); Echo str_replace($find, $replace, $string);
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught Error: Call to undefined function length() in /in/uNZB6:10 Stack trace: #0 {main} thrown in /in/uNZB6 on line 10
Process exited with code 255.
Output for 5.6.0 - 5.6.40
Fatal error: Call to undefined function length() in /in/uNZB6 on line 10
Process exited with code 255.

preferences:
238.17 ms | 401 KiB | 283 Q