3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expression = "/(?J)\b(?: (?<obj>i)(?:(?<part>'m)|\s(?<part>am|was))? |(?<obj>you|they)(?:(?<part>'re)|\s(?<part>are|were))? |(?<obj>it|he|she)(?:(?<part>'s)|\s(?<part>is|was))? |(?<obj>my|your|it(?<part>sel(f|ves))) )\b/uix"; $message = "that you are not who you think you're but I'm not myself either"; echo $output = preg_replace_callback($expression, function ($matches){ $o = ''; $object = strtolower($matches['obj']); switch($object){ case 'i': $o = 'you'; break; case 'you': $o = 'I'; break; case 'yourself': $o = 'myself'; break; case 'myself': $o = 'yourself'; break; default: $o = $object; } if(isset($matches['part'])){ switch($part = strtolower($matches['part'])){ case "'re": case "are": if($object == 'you') $o .= ' am'; break; case 'am': $o .= ' are'; break; case "'m": $o .= "'re"; break; case 'was': if(!in_array($object, ['he','she','it'])) $o .= ' were'; break; case 'were': if($object == 'you') $o .= ' was'; break; } } return $o; }, $message );

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.70.0050.01017.00
8.3.60.0060.00917.00
8.3.50.0140.00821.42
8.3.40.0040.01119.21
8.3.30.0090.00618.98
8.3.20.0080.00021.82
8.3.10.0040.00420.85
8.3.00.0070.00021.95
8.2.180.0030.01416.88
8.2.170.0100.01022.96
8.2.160.0090.00619.45
8.2.150.0030.00624.18
8.2.140.0060.00324.66
8.2.130.0080.00021.07
8.2.120.0050.00326.35
8.2.110.0090.00022.37
8.2.100.0030.01019.89
8.2.90.0050.00318.25
8.2.80.0000.00817.97
8.2.70.0040.00417.80
8.2.60.0030.00618.05
8.2.50.0000.00818.10
8.2.40.0080.00020.55
8.2.30.0050.00519.45
8.2.20.0000.00718.27
8.2.10.0040.00418.16
8.2.00.0050.00317.97
8.1.280.0120.00325.92
8.1.270.0040.00423.96
8.1.260.0000.00928.09
8.1.250.0080.00028.09
8.1.240.0090.00022.21
8.1.230.0070.00418.94
8.1.220.0050.00318.04
8.1.210.0000.00818.77
8.1.200.0040.00417.60
8.1.190.0000.00817.73
8.1.180.0080.00018.10
8.1.170.0030.00518.62
8.1.160.0080.00022.15
8.1.150.0030.00519.05
8.1.140.0050.00319.73
8.1.130.0030.00317.97
8.1.120.0000.00917.71
8.1.110.0040.00417.64
8.1.100.0040.00417.58
8.1.90.0040.00417.59
8.1.80.0050.00217.70
8.1.70.0000.00817.57
8.1.60.0030.00617.82
8.1.50.0040.00417.78
8.1.40.0090.00017.63
8.1.30.0030.00517.88
8.1.20.0000.00817.91
8.1.10.0000.00817.73
8.1.00.0060.00317.73
8.0.300.0000.00918.77
8.0.290.0050.00217.00
8.0.280.0030.00318.45
8.0.270.0090.00017.43
8.0.260.0050.00317.47
8.0.250.0030.00517.23
8.0.240.0000.00717.22
8.0.230.0000.00817.08
8.0.220.0000.00717.05
8.0.210.0000.00717.16
8.0.200.0030.00317.23
8.0.190.0070.00017.19
8.0.180.0040.00417.24
8.0.170.0070.00017.20
8.0.160.0040.00417.20
8.0.150.0070.00417.08
8.0.140.0030.00517.03
8.0.130.0000.00713.59
8.0.120.0040.00417.22
8.0.110.0040.00717.23
8.0.100.0040.00417.01
8.0.90.0000.00717.30
8.0.80.0110.00517.20
8.0.70.0030.00517.23
8.0.60.0040.00417.12
8.0.50.0040.00417.16
8.0.30.0060.01317.48
8.0.20.0070.01217.50
8.0.10.0040.00417.26
8.0.00.0090.00916.98
7.4.330.0000.00715.26
7.4.320.0030.00516.84
7.4.300.0040.00416.79
7.4.290.0000.00716.98
7.4.280.0030.00616.79
7.4.270.0000.00716.96
7.4.260.0070.00016.97
7.4.250.0000.00716.76
7.4.240.0070.00016.99
7.4.230.0030.00316.99
7.4.220.0140.01016.66
7.4.210.0070.01016.87
7.4.200.0070.00016.75
7.4.160.0090.00716.90
7.4.150.0090.00917.40
7.4.140.0120.00717.86
7.4.130.0090.00916.77
7.4.120.0110.00716.96
7.4.110.0130.01016.89
7.4.100.0120.00916.72
7.4.90.0080.00816.74
7.4.80.0130.01319.39
7.4.70.0160.00017.03
7.4.60.0130.00616.71
7.4.50.0080.00816.67
7.4.40.0110.00716.79
7.4.30.0100.01216.81
7.4.10.0060.01016.87
7.4.00.0110.00615.80
7.3.330.0030.00313.59
7.3.320.0040.00313.58
7.3.310.0040.00416.48
7.3.300.0040.00416.54
7.3.290.0050.00216.56
7.3.280.0110.00816.56
7.3.270.0120.00617.40
7.3.260.0120.00716.63
7.3.250.0090.00816.75
7.3.240.0060.01316.82
7.3.230.0180.00016.61
7.3.210.0070.01016.56
7.3.200.0120.00916.77
7.3.190.0130.01016.63
7.3.180.0060.01116.69
7.3.170.0070.01116.77
7.3.160.0120.00916.68
7.3.130.0040.01116.75
7.3.120.0090.00915.92
7.3.110.0080.00815.95
7.3.100.0060.01115.86
7.3.90.0030.01215.79
7.3.80.0090.00715.84
7.3.70.0070.00915.81
7.3.60.0090.00515.80
7.3.50.0050.00715.87
7.3.40.0030.01215.89
7.3.30.0030.01015.73
7.3.20.0080.00617.63
7.3.10.0080.00717.65
7.3.00.0070.00517.62
7.2.330.0110.00816.83
7.2.320.0090.00816.77
7.2.310.0100.00717.01
7.2.300.0110.01216.87
7.2.290.0150.00616.84
7.2.260.0130.00716.70
7.2.250.0120.00715.93
7.2.240.0060.01116.11
7.2.230.0070.01115.97
7.2.220.0090.01115.98
7.2.210.0130.00515.96
7.2.200.0080.00516.10
7.2.190.0050.00916.10
7.2.180.0080.00716.01
7.2.170.0050.00815.94
7.2.160.0040.01116.79
7.2.150.0070.00318.77
7.2.140.0030.01218.61
7.2.130.0000.01218.68
7.2.120.0030.01418.52
7.2.110.0100.00718.66
7.2.100.0070.01318.73
7.2.90.0060.00818.64
7.2.80.0030.00918.62
7.2.70.0100.00718.28
7.2.60.0030.01317.52
7.2.50.0040.01118.83
7.2.40.0130.00318.70
7.2.30.0060.00918.66
7.2.20.0070.01418.65
7.2.10.0090.00618.63
7.2.00.0000.01718.74
7.1.330.0030.00916.92
7.1.320.0080.00816.78
7.1.310.0060.01116.63
7.1.300.0030.01016.73
7.1.290.0070.00816.85
7.1.280.0050.00716.76
7.1.270.0070.00616.85
7.1.260.0080.00816.75
7.1.250.0070.00317.59
7.1.240.0000.01017.54
7.1.230.0090.00617.69
7.1.220.0070.00317.52
7.1.210.0060.00917.56
7.1.200.0070.00616.72
7.1.190.0120.00617.64
7.1.180.0060.01017.45
7.1.170.0080.00417.56
7.1.160.0060.00617.55
7.1.150.0090.00917.45
7.1.140.0030.00717.57
7.1.130.0060.01017.60
7.1.120.0030.01317.57
7.1.110.0060.00917.70
7.1.100.0090.00617.51
7.1.90.0080.00817.60
7.1.80.0040.01117.65
7.1.70.0050.00617.59
7.1.60.0120.00817.60
7.1.50.0030.00717.65
7.1.40.0100.00317.64
7.1.30.0000.01517.80
7.1.20.0060.00617.65
7.1.10.0030.01417.71
7.1.00.0090.03719.99
7.0.330.0060.00617.29
7.0.320.0060.00617.34
7.0.310.0000.01517.21
7.0.300.0030.00917.18
7.0.290.0070.00717.40
7.0.280.0030.01217.20
7.0.270.0000.01517.27
7.0.260.0070.01017.04
7.0.250.0030.01217.18
7.0.240.0000.01317.51
7.0.230.0070.00717.41
7.0.220.0140.00017.11
7.0.210.0070.00717.05
7.0.200.0030.01216.98
7.0.190.0100.00317.23
7.0.180.0030.00717.29
7.0.170.0060.00917.33
7.0.160.0080.00317.26
7.0.150.0070.01017.14
7.0.140.0090.00617.27
7.0.130.0040.01117.15
7.0.120.0060.00917.29
7.0.110.0130.03418.71
7.0.100.0070.03418.71
7.0.90.0090.03418.81
7.0.80.0080.03018.83
7.0.70.0120.03218.89
7.0.60.0090.03018.64
7.0.50.0050.04018.77
7.0.40.0170.03217.65
7.0.30.0160.03217.73
7.0.20.0300.02817.81
7.0.10.0180.03617.72
7.0.00.0270.03617.70
5.6.400.0000.01616.01
5.6.390.0070.00716.25
5.6.380.0000.01216.04
5.6.370.0110.00716.02
5.6.360.0090.00015.97
5.6.350.0070.00716.41
5.6.340.0060.00616.16
5.6.330.0040.00815.70
5.6.320.0030.01016.12
5.6.310.0040.01116.07
5.6.300.0090.00616.13
5.6.290.0060.00915.98
5.6.280.0000.01416.13
5.6.270.0070.01116.12
5.6.260.0110.03318.61
5.6.250.0140.03218.62
5.6.240.0080.03118.34
5.6.230.0110.03218.45
5.6.220.0050.03718.56
5.6.210.0100.03318.45
5.6.200.0070.03418.45
5.6.190.0070.03418.45
5.6.180.0050.03518.41
5.6.170.0080.03018.58
5.6.160.0080.03318.54
5.6.150.0100.03018.42
5.6.140.0110.02818.45
5.6.130.0130.03618.53
5.6.120.0050.03518.61
5.6.110.0030.03818.49
5.6.100.0130.02718.34
5.6.90.0100.03018.51
5.6.80.0070.03418.08
5.6.70.0120.02818.21
5.6.60.0110.04318.17
5.6.50.0050.04018.13
5.6.40.0020.03518.05
5.6.30.0100.02918.10
5.6.20.0090.03018.25
5.6.10.0060.03018.20
5.6.00.0050.03218.12

preferences:
93.74 ms | 401 KiB | 5 Q