3v4l.org

run code in 300+ PHP versions simultaneously
<?php $example1 = 'Blah blah blah. THIS SENTENCE SHOULD BE SELECTED [bbcode]'; $example2 = 'THIS SENTENCE SHOULD BE SELECTED [bbcode]'; $example3 = 'A trick sentence. And another. THIS SENTENCE SHOULD BE SELECTED [bbcode]'; function extractSentence($string) { $before = substr($string, 0, strpos($string, '[bbcode]')); return trim(substr($before, strrpos($before, '.')), "\n ."); } echo extractSentence($example1); echo "\n"; echo extractSentence($example2); echo "\n"; echo extractSentence($example3); echo "\n";

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.5.20.0110.00819.41
8.5.10.0090.00820.20
8.5.00.0130.00820.19
8.4.170.0110.01121.88
8.4.160.0070.01321.93
8.4.150.0000.00214.05
8.4.140.0100.01317.39
8.4.130.0060.00317.62
8.4.120.0060.00320.58
8.4.110.0070.00322.68
8.4.100.0050.00417.84
8.4.90.0140.00617.48
8.4.80.0070.00319.40
8.4.70.0070.00917.66
8.4.60.0060.00218.61
8.4.50.0150.00717.80
8.4.40.0100.01017.87
8.4.30.0120.00918.76
8.4.20.0120.00817.80
8.4.10.0130.00723.66
8.3.300.0140.00918.35
8.3.290.0130.01020.93
8.3.280.0130.00918.18
8.3.270.0130.00616.69
8.3.260.0060.00516.60
8.3.250.0150.00418.86
8.3.240.0120.00716.59
8.3.230.0090.01016.30
8.3.220.0040.00317.23
8.3.210.0050.00516.55
8.3.200.0080.00116.65
8.3.190.0140.00416.84
8.3.180.0050.00318.21
8.3.170.0080.01117.00
8.3.160.0120.00619.96
8.3.150.0080.00018.97
8.3.140.0120.00317.28
8.3.130.0000.00818.47
8.3.120.0080.00020.71
8.3.110.0060.00316.79
8.3.100.0040.00418.27
8.3.90.0040.00426.77
8.3.80.0060.00316.48
8.3.70.0060.00916.58
8.3.60.0060.01018.39
8.3.50.0100.01020.12
8.3.40.0080.00620.38
8.3.30.0040.01118.54
8.3.20.0080.00024.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.300.0140.00622.26
8.2.290.0060.00320.61
8.2.280.0120.00718.12
8.2.270.0120.00616.93
8.2.260.0120.00617.13
8.2.250.0080.00018.10
8.2.240.0150.00019.10
8.2.230.0050.00320.94
8.2.220.0080.00024.06
8.2.210.0070.00326.77
8.2.200.0060.00318.04
8.2.190.0070.00716.58
8.2.180.0120.00325.92
8.2.170.0120.00318.71
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00426.16
8.2.110.0090.00021.12
8.2.100.0000.01019.32
8.2.90.0000.00817.84
8.2.80.0030.00520.50
8.2.70.0040.00417.50
8.2.60.0070.00318.04
8.2.50.0000.00918.07
8.2.40.0130.00017.96
8.2.30.0030.00618.03
8.2.20.0040.00419.17
8.2.10.0000.00918.05
8.2.00.0040.00419.34
8.1.340.0090.01119.58
8.1.330.0120.00818.20
8.1.320.0100.00916.00
8.1.310.0040.00418.44
8.1.300.0130.00318.00
8.1.290.0060.00330.84
8.1.280.0060.00925.92
8.1.270.0040.00424.66
8.1.260.0000.00726.35
8.1.250.0000.00728.09
8.1.240.0030.00621.99
8.1.230.0050.00520.89
8.1.220.0060.00317.78
8.1.210.0000.00918.91
8.1.200.0070.00317.22
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00418.48
8.1.160.0040.00419.02
8.1.150.0070.00018.60
8.1.140.0050.00317.44
8.1.130.0030.00318.75
8.1.120.0020.00517.30
8.1.110.0030.00717.36
8.1.100.0100.01017.34
8.1.90.0090.00917.17
8.1.80.0100.00917.41
8.1.70.0140.00117.21
8.1.60.0130.00617.60
8.1.50.0100.00217.40
8.1.40.0120.00817.51
8.1.30.0130.00917.60
8.1.20.0170.00317.63
8.1.10.0140.00617.38
8.1.00.0110.00817.39
8.0.300.0080.00020.03
8.0.290.0050.00316.75
8.0.280.0000.00718.46
8.0.270.0030.00317.18
8.0.260.0000.00818.49
8.0.250.0040.00416.97
8.0.240.0160.00016.83
8.0.230.0050.01016.77
8.0.220.0070.00716.77
8.0.210.0120.00216.82
8.0.200.0120.00316.76
8.0.190.0110.00316.73
8.0.180.0130.00216.74
8.0.170.0050.00916.82
8.0.160.0120.00316.76
8.0.150.0050.01016.68
8.0.140.0120.00316.60
8.0.130.0120.00416.69
8.0.120.0120.00416.74
8.0.110.0140.00016.71
8.0.100.0050.00816.78
8.0.90.0150.00016.69
8.0.80.0090.00616.71
8.0.70.0100.00516.78
8.0.60.0080.00816.69
8.0.50.0150.00016.80
8.0.30.0110.00416.79
8.0.20.0140.00016.86
8.0.10.0070.00716.85
7.4.330.0020.00215.55
7.4.320.0040.00416.38
7.4.300.0120.00416.49
7.4.290.0170.00016.57
7.4.280.0110.00416.51
7.4.270.0130.00416.57
7.4.260.0050.01016.44
7.4.250.0130.00416.38
7.4.240.0070.00216.52
7.4.230.0080.00816.39
7.4.220.0130.00316.45
7.4.210.0120.00316.47
7.4.200.0070.00716.39
7.4.190.0090.00616.54
7.4.180.0150.00016.47
7.4.160.0090.00616.50
7.4.150.0100.00616.35
7.4.140.0120.00416.34
7.4.130.0160.00016.46
7.4.120.0100.00516.48
7.4.110.0110.00416.34
7.4.100.0090.00416.52
7.4.90.0040.01116.46
7.4.80.0130.00216.44
7.4.70.0090.00616.24
7.4.60.0110.00416.45
7.4.50.0090.00616.39
7.4.40.0070.00716.44
7.4.30.0100.00516.33
7.4.20.0080.00616.43
7.4.10.0100.00516.40
7.4.00.0140.00016.50

preferences:
32.59 ms | 403 KiB | 5 Q