3v4l.org

run code in 300+ PHP versions simultaneously
<?php $passes = ["fo\"obar", "foobar\"", "foobar\\\\\"", "foo\\\"\"bar"]; $expect = '{"foo":{"password":"****"}}'; foreach ($passes as $pass) { $json = json_encode(["foo"=>["password"=>$pass]]); echo $expect; echo ""; echo preg_replace('{("password"\s*:\s*)"(?:[^"\\\\]|(?:\\\\.))*"}', '$1"****"', $json); if ($expect !== preg_replace('{("password"\s*:\s*)"(?:[^"\\\\]|(?:\\\\.))*"}', '$1"****"', $json)) { echo "Password $pass is out of this league!"; exit(1); } } echo "Filter test ok!";

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.3.60.0200.00016.88
8.3.50.0070.00716.62
8.3.40.0060.00918.91
8.3.30.0090.00618.79
8.3.20.0040.00420.02
8.3.10.0080.00021.90
8.3.00.0040.00420.77
8.2.180.0140.00718.66
8.2.170.0120.00322.96
8.2.160.0100.00322.29
8.2.150.0050.00224.18
8.2.140.0000.00724.66
8.2.130.0000.00826.16
8.2.120.0090.00019.83
8.2.110.0030.00722.33
8.2.100.0000.01218.02
8.2.90.0040.00419.25
8.2.80.0000.00817.97
8.2.70.0090.00017.86
8.2.60.0030.00618.03
8.2.50.0000.00818.16
8.2.40.0000.00720.42
8.2.30.0000.00821.05
8.2.20.0040.00418.01
8.2.10.0040.00418.23
8.2.00.0030.00518.21
8.1.280.0040.01225.92
8.1.270.0080.00023.82
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0090.00020.89
8.1.230.0070.00419.04
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0060.00617.35
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00818.66
8.1.160.0040.00419.05
8.1.150.0070.00018.83
8.1.140.0040.00419.61
8.1.130.0030.00318.93
8.1.120.0060.00317.56
8.1.110.0040.00417.68
8.1.100.0000.00717.62
8.1.90.0000.00717.46
8.1.80.0040.00417.61
8.1.70.0070.00017.54
8.1.60.0000.00917.58
8.1.50.0030.00617.75
8.1.40.0000.00817.59
8.1.30.0050.00317.83
8.1.20.0030.00517.75
8.1.10.0040.00417.63
8.1.00.0080.00017.60
8.0.300.0090.00018.77
8.0.290.0090.00016.75
8.0.280.0040.00418.59
8.0.270.0000.00717.26
8.0.260.0000.00616.84
8.0.250.0070.00017.12
8.0.240.0080.00016.95
8.0.230.0040.00417.08
8.0.220.0040.00417.03
8.0.210.0000.00717.07
8.0.200.0000.00816.98
8.0.190.0030.00617.10
8.0.180.0000.01017.13
8.0.170.0000.00716.99
8.0.160.0000.00817.07
8.0.150.0000.00716.91
8.0.140.0040.00416.92
8.0.130.0030.00513.41
8.0.120.0050.00317.05
8.0.110.0040.00417.02
8.0.100.0050.00317.05
8.0.90.0030.00616.98
8.0.80.0060.01217.04
8.0.70.0040.00416.98
8.0.60.0030.00517.12
8.0.50.0080.00016.88
8.0.30.0100.00717.18
8.0.20.0090.01517.40
8.0.10.0040.00417.24
8.0.00.0060.01217.01
7.4.330.0000.00515.55
7.4.320.0030.00316.79
7.4.300.0040.00416.83
7.4.290.0070.00416.83
7.4.280.0000.00816.85
7.4.270.0040.00416.75
7.4.260.0000.00716.73
7.4.250.0000.00716.79
7.4.240.0000.00716.82
7.4.230.0030.00316.83
7.4.220.0030.02116.89
7.4.210.0090.00616.63
7.4.200.0000.00716.89
7.4.160.0130.00716.70
7.4.150.0090.00917.40
7.4.140.0140.00417.86
7.4.130.0130.00916.74
7.4.120.0090.01116.76
7.4.110.0130.00316.82
7.4.100.0140.00316.82
7.4.90.0140.00316.77
7.4.80.0000.01819.39
7.4.70.0030.01316.73
7.4.60.0140.00316.86
7.4.50.0030.01216.66
7.4.40.0090.00816.63
7.4.30.0140.00316.85
7.4.10.0080.01115.30
7.4.00.0080.01115.32
7.3.330.0050.00013.30
7.3.320.0030.00313.34
7.3.310.0030.00316.48
7.3.300.0030.00316.51
7.3.290.0090.00716.47
7.3.280.0090.00916.47
7.3.270.0120.00617.40
7.3.260.0080.01016.80
7.3.250.0100.00716.60
7.3.240.0130.00716.66
7.3.230.0090.01316.84
7.3.210.0100.00616.65
7.3.200.0040.01316.71
7.3.190.0120.00416.77
7.3.180.0040.01116.65
7.3.170.0070.00816.36
7.3.160.0100.00716.43
7.3.130.0110.00715.09
7.3.120.0100.01015.31
7.3.110.0070.00915.06
7.3.100.0050.01115.11
7.3.90.0080.00915.25
7.3.80.0080.00415.01
7.3.70.0060.00814.91
7.3.60.0120.00015.03
7.3.50.0080.00414.93
7.3.40.0050.01014.88
7.3.30.0100.00414.78
7.3.20.0090.00716.69
7.3.10.0030.01116.72
7.3.00.0060.00916.77
7.2.330.0060.01116.85
7.2.320.0130.01016.95
7.2.310.0080.00816.90
7.2.300.0100.00616.87
7.2.290.0080.00816.88
7.2.260.0100.01015.13
7.2.250.0070.01015.43
7.2.240.0090.00815.12
7.2.230.0080.01015.18
7.2.220.0040.01115.36
7.2.210.0070.00915.21
7.2.200.0040.01215.37
7.2.190.0080.00815.10
7.2.180.0070.00815.34
7.2.170.0080.00815.14
7.2.160.0050.01015.30
7.2.150.0020.00917.13
7.2.140.0110.00316.80
7.2.130.0100.00717.15
7.2.120.0070.00917.03
7.2.110.0130.00216.91
7.2.100.0070.00516.94
7.2.90.0090.01017.08
7.2.80.0080.00916.90
7.2.70.0080.00617.04
7.2.60.0080.00717.06
7.2.50.0100.01017.15
7.2.40.0110.00616.99
7.2.30.0030.01117.01
7.2.20.0080.00716.93
7.2.10.0050.01017.14
7.2.00.0080.00917.73
7.1.330.0070.00616.03
7.1.320.0050.01116.14
7.1.310.0090.00516.08
7.1.300.0070.00515.95
7.1.290.0030.00915.94
7.1.280.0050.01115.86
7.1.270.0060.01015.81
7.1.260.0040.01015.88
7.1.250.0030.00915.89
7.1.240.0080.00516.25
7.1.230.0060.00615.97
7.1.220.0040.00415.81
7.1.210.0060.00915.80
7.1.200.0030.00916.09
7.1.190.0040.01216.04
7.1.180.0090.00615.99
7.1.170.0060.00915.91
7.1.160.0110.00415.83
7.1.150.0000.00816.16
7.1.140.0000.00816.09
7.1.130.0070.00315.99
7.1.120.0070.00716.03
7.1.110.0060.01015.94
7.1.100.0070.00717.33
7.1.90.0110.00415.87
7.1.80.0060.01215.99
7.1.70.0060.00716.60
7.1.60.0320.01424.95
7.1.50.0300.01024.55
7.1.40.0300.01024.28
7.1.30.0280.01224.39
7.1.20.0220.01624.52
7.1.10.0250.00815.37
7.1.00.0220.00715.57
7.0.330.0080.00315.57
7.0.320.0070.00715.61
7.0.310.0040.00415.26
7.0.300.0070.00715.63
7.0.290.0110.00315.60
7.0.280.0040.01215.34
7.0.270.0000.01215.42
7.0.260.0060.00815.50
7.0.250.0000.01115.49
7.0.240.0070.00715.54
7.0.230.0070.00415.45
7.0.220.0100.00615.66
7.0.210.0070.00315.55
7.0.200.0330.01015.23
7.0.190.0200.00915.29
7.0.180.0590.00515.13
7.0.170.0240.00915.12
7.0.160.0230.00615.17
7.0.150.0190.01215.17
7.0.140.0160.01115.36
7.0.130.0230.00615.18
7.0.120.0280.01015.32
7.0.110.0210.00915.23
7.0.100.0220.01014.99
7.0.90.0200.01315.20
7.0.80.0240.00515.16
7.0.70.0250.01015.20
7.0.60.0230.00815.09
7.0.50.0270.00815.35
7.0.40.0200.01014.17
7.0.30.0250.00614.27
7.0.20.0310.00914.04
7.0.10.0370.00814.13
7.0.00.0270.01314.27
5.6.400.0060.00614.30
5.6.390.0060.00914.77
5.6.380.0060.01214.75
5.6.370.0050.00514.32
5.6.360.0090.00914.40
5.6.350.0030.01014.30
5.6.340.0040.01114.31
5.6.330.0060.00314.14
5.6.320.0060.00314.45
5.6.310.0040.01114.55
5.6.300.0030.01014.64
5.6.290.0030.00614.57
5.6.280.0070.00714.18
5.6.270.0100.00314.30
5.6.260.0080.00414.47
5.6.250.0030.01114.22
5.6.240.0000.01114.21
5.6.230.0090.00614.61
5.6.220.0000.01314.42
5.6.210.0090.00614.02
5.6.200.0060.00614.44
5.6.190.0070.00714.54
5.6.180.0030.01514.29
5.6.170.0070.00714.37
5.6.160.0090.00914.27
5.6.150.0100.00314.29
5.6.140.0030.01014.30
5.6.130.0060.00914.68
5.6.120.0060.00614.41
5.6.110.0030.01014.48
5.6.100.0100.00614.44
5.6.90.0100.00314.54
5.6.80.0100.00314.29
5.6.70.0030.00714.39
5.6.60.0030.00614.33
5.6.50.0000.01414.27
5.6.40.0060.00914.03
5.6.30.0030.01214.55
5.6.20.0060.01014.15
5.6.10.0060.00614.24
5.6.00.0080.00314.29

preferences:
58.72 ms | 400 KiB | 5 Q