3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bom = "\xef\xbb\xbf"; $json_string = $bom.'{"greeting":"Tschüss welt","emoji":"😃"}'; var_dump( $json_string, preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $json_string), json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $json_string), true) ); // removing the BOM sequence only and from the very beginning only $json_string = preg_replace("/^\xEF\xBB\xBF/", '', $json_string); var_dump( $json_string, json_decode($json_string, true) );

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.130.0120.01018.12
8.4.120.0100.00920.45
8.4.110.0050.00519.09
8.4.100.0060.00417.79
8.4.90.0120.00917.68
8.4.80.0420.01017.82
8.4.70.0410.01217.63
8.4.60.0420.00817.82
8.4.50.0430.00717.64
8.4.40.0420.01117.61
8.4.30.0420.01117.39
8.4.20.0490.00917.73
8.4.10.0470.01017.70
8.3.260.0100.00916.86
8.3.250.0110.00518.87
8.3.240.0060.00516.62
8.3.230.0050.00616.57
8.3.220.0310.00816.97
8.3.210.0150.00516.97
8.3.200.0270.00516.97
8.3.190.0400.00816.97
8.3.180.0390.00916.97
8.3.170.0410.01116.97
8.3.160.0410.00916.97
8.3.150.0410.01016.97
8.3.140.0400.00916.97
8.3.130.0150.00516.97
8.3.120.0380.00816.97
8.3.110.0330.01016.97
8.3.100.0460.00516.97
8.3.90.0430.00916.97
8.3.80.0460.00616.97
8.3.70.0320.00416.97
8.3.60.0230.00216.97
8.3.50.0160.00616.97
8.3.40.0210.00217.39
8.3.30.0310.00817.48
8.3.20.0340.00617.33
8.3.10.0300.01117.46
8.3.00.0300.00817.67
8.2.290.0120.00718.88
8.2.280.0270.01116.97
8.2.270.0360.00916.97
8.2.260.0400.00816.97
8.2.250.0220.00416.97
8.2.240.0330.00616.97
8.2.230.0330.00416.97
8.2.220.0250.00316.97
8.2.210.0290.00516.97
8.2.200.0250.01116.97
8.2.190.0240.00916.97
8.2.180.0270.00716.97
8.2.170.0280.00517.54
8.2.160.0360.00917.80
8.2.150.0350.00817.79
8.2.140.0340.00917.57
8.2.130.0360.01017.27
8.2.120.0380.01017.52
8.2.110.0370.00817.61
8.2.100.0270.00417.82
8.2.90.0370.00717.90
8.2.80.0330.00717.60
8.2.70.0190.00117.66
8.2.60.0350.00917.65
8.2.50.0400.00617.58
8.2.40.0330.00517.74
8.2.30.0220.00817.43
8.2.20.0150.00517.54
8.2.10.0240.01017.41
8.2.00.0350.00517.40

preferences:
25.75 ms | 403 KiB | 5 Q