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)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.60.0120.00317.00
8.3.50.0140.00716.99
8.3.40.0080.00819.09
8.3.30.0070.00718.96
8.3.20.0080.00021.91
8.3.10.0050.00320.86
8.3.00.0040.00421.77
8.2.180.0090.00916.88
8.2.170.0120.00322.96
8.2.160.0060.01219.45
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0080.00021.13
8.2.120.0040.00426.35
8.2.110.0060.00322.28
8.2.100.0040.00818.22
8.2.90.0040.00419.51
8.2.80.0070.00318.00
8.2.70.0040.00418.13
8.2.60.0040.00418.18
8.2.50.0040.00418.10
8.2.40.0000.00920.55
8.2.30.0060.00319.59
8.2.20.0080.00018.34
8.2.10.0080.00018.35
8.2.00.0050.00218.16
8.1.270.0080.00024.09
8.1.260.0000.00928.09
8.1.250.0020.00528.09
8.1.240.0120.00623.92
8.1.230.0070.00717.77
8.1.220.0060.00318.02
8.1.210.0040.00418.77
8.1.200.0000.01017.38
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0050.00318.74
8.1.160.0040.00422.22
8.1.150.0000.00718.98
8.1.140.0030.00619.78
8.1.130.0040.00417.77
8.1.120.0030.00617.66
8.1.110.0030.00517.59
8.1.100.0040.00317.74
8.1.90.0040.00417.72
8.1.80.0000.00717.59
8.1.70.0030.00517.54
8.1.60.0040.00417.71
8.1.50.0060.00317.74
8.1.40.0050.00317.68
8.1.30.0030.00517.86
8.1.20.0080.00017.75
8.1.10.0000.00717.78
8.1.00.0030.00617.75
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0050.00318.54
8.0.270.0050.00317.37
8.0.260.0000.00817.35
8.0.250.0000.00917.28
8.0.240.0040.00417.10
8.0.230.0080.00017.19
8.0.220.0000.00717.18
8.0.210.0000.00717.07
8.0.200.0030.00317.24
8.0.190.0040.00417.14
8.0.180.0030.00517.12
8.0.170.0050.00317.16
8.0.160.0030.00317.13
8.0.150.0110.00016.95
8.0.140.0070.00017.11
8.0.130.0030.00313.66
8.0.120.0050.00317.26
8.0.110.0070.00317.29
8.0.100.0000.00717.04
8.0.90.0000.00717.11
8.0.80.0100.00717.13
8.0.70.0030.00517.13
8.0.60.0040.00417.27
8.0.50.0040.00417.14
8.0.30.0140.00317.37
8.0.20.0110.01017.41
8.0.10.0000.00717.19
8.0.00.0070.01116.93
7.4.330.0030.00315.21
7.4.320.0030.00616.93
7.4.300.0000.00716.99
7.4.290.0000.00716.79
7.4.280.0090.00016.94
7.4.270.0030.00516.93
7.4.260.0000.00716.92
7.4.250.0040.00416.78
7.4.240.0000.00816.88
7.4.230.0030.00316.95
7.4.220.0130.00316.86
7.4.210.0080.00716.91
7.4.200.0000.00716.97
7.4.160.0080.00816.72
7.4.150.0180.00017.40
7.4.140.0170.00717.86
7.4.130.0130.00516.97
7.4.120.0080.01016.87
7.4.110.0030.01316.80
7.4.100.0090.00916.84
7.4.90.0120.00616.86
7.4.80.0150.01019.39
7.4.70.0100.00716.70
7.4.60.0090.00916.53
7.4.50.0070.01116.77
7.4.40.0130.00516.76
7.4.30.0120.00616.95
7.4.10.0070.00915.17
7.4.00.0100.00715.23
7.3.330.0000.00613.53
7.3.320.0030.00313.41
7.3.310.0030.00416.73
7.3.300.0030.00316.50
7.3.290.0030.00316.43
7.3.280.0100.00916.55
7.3.270.0080.01617.40
7.3.260.0140.00716.71
7.3.250.0130.00516.65
7.3.240.0120.00716.73
7.3.230.0040.01216.60
7.3.210.0120.00616.77
7.3.200.0070.01616.48
7.3.190.0040.01216.53
7.3.180.0120.00616.71
7.3.170.0080.00816.61
7.3.160.0060.01616.68
7.3.130.0070.01215.09
7.3.120.0080.00915.31
7.3.110.0050.01415.03
7.3.100.0060.00815.17
7.3.90.0070.00715.26
7.3.80.0100.00415.04
7.3.70.0040.01115.05
7.3.60.0050.00915.00
7.3.50.0050.00715.12
7.3.40.0090.00915.14
7.3.30.0060.00815.01
7.3.20.0070.00516.87
7.3.10.0080.00816.85
7.3.00.0080.01016.74
7.2.330.0090.00916.89
7.2.320.0120.00616.87
7.2.310.0070.01016.87
7.2.300.0090.01416.85
7.2.290.0130.00716.88
7.2.260.0030.01715.20
7.2.250.0110.00715.29
7.2.240.0030.01115.38
7.2.230.0030.01015.14
7.2.220.0050.01015.33
7.2.210.0020.01315.32
7.2.200.0080.00615.20
7.2.190.0080.00515.13
7.2.180.0020.01515.42
7.2.170.0070.01015.34
7.2.160.0050.01015.21
7.2.150.0060.00717.06
7.2.140.0100.00517.11
7.2.130.0100.00617.07
7.2.120.0050.01016.99
7.2.110.0290.00617.07
7.2.100.0060.00916.94
7.2.90.0080.00717.08
7.2.80.0110.00417.23
7.2.70.0100.00717.18
7.2.60.0120.00717.03
7.2.50.0090.00817.18
7.2.40.0080.00917.08
7.2.30.0110.00917.17
7.2.20.0100.00917.14
7.2.10.0060.01017.07
7.2.00.0100.00617.17
7.1.330.0000.01416.13
7.1.320.0070.00916.19
7.1.310.0030.01216.08
7.1.300.0040.00616.14
7.1.290.0050.01215.94
7.1.280.0090.00815.92
7.1.270.0110.00416.06
7.1.260.0050.01016.16
7.1.250.0120.00615.90
7.1.240.0050.00816.02
7.1.230.0060.00515.85
7.1.220.0040.01016.09
7.1.210.0050.00415.84
7.1.200.0070.00716.09
7.1.190.0020.01116.14
7.1.180.0060.00816.21
7.1.170.0030.01216.17
7.1.160.0070.00916.04
7.1.150.0050.01016.03
7.1.140.0050.01015.88
7.1.130.0050.00716.17
7.1.120.0050.00715.98
7.1.110.0030.01016.08
7.1.100.0050.00816.06
7.1.90.0070.00715.99
7.1.80.0040.01016.13
7.1.70.0040.00716.59
7.1.60.0050.01016.58
7.1.50.0040.01216.22
7.1.40.0020.01415.94
7.1.30.0060.00616.13
7.1.20.0090.00516.01
7.1.10.0060.01316.08
7.1.00.0050.02918.15
7.0.330.0010.00915.46
7.0.320.0070.00415.44
7.0.310.0020.00715.59
7.0.300.0050.00615.47
7.0.290.0020.00915.47
7.0.280.0080.00615.70
7.0.270.0030.00915.62
7.0.260.0070.00515.47
7.0.250.0130.00315.72
7.0.240.0060.00415.50
7.0.230.0080.00515.77
7.0.220.0060.00815.57
7.0.210.0060.00915.56
7.0.200.0110.00615.32
7.0.190.0080.00515.71
7.0.180.0030.01215.73
7.0.170.0070.00715.69
7.0.160.0040.00515.72
7.0.150.0030.01215.56
7.0.140.0070.00715.71
7.0.130.0050.00815.61
7.0.120.0070.00715.58
7.0.110.0170.03217.10
7.0.100.0130.03617.21
7.0.90.0100.02817.15
7.0.80.0200.02317.34
7.0.70.0240.01817.22
7.0.60.0170.02417.13
7.0.50.0160.02317.27
7.0.40.0150.03015.88
7.0.30.0190.02315.87
7.0.20.0150.02615.89
7.0.10.0140.02415.96
7.0.00.0120.02616.00
5.6.400.0060.00714.64
5.6.390.0030.00814.44
5.6.380.0110.00414.56
5.6.370.0010.01014.71
5.6.360.0060.00914.57
5.6.350.0020.01014.51
5.6.340.0040.00914.84
5.6.330.0050.00914.86
5.6.320.0050.01314.85
5.6.310.0110.00214.47
5.6.300.0090.00914.89
5.6.290.0110.00514.67
5.6.280.0050.01014.66
5.6.270.0030.01014.58
5.6.260.0060.03316.72
5.6.250.0090.02716.79
5.6.240.0060.02516.66
5.6.230.0040.03016.71
5.6.220.0090.02216.66
5.6.210.0120.02616.62
5.6.200.0070.02416.54
5.6.190.0040.02916.70
5.6.180.0060.02616.71
5.6.170.0120.02216.66
5.6.160.0120.02316.71
5.6.150.0070.02816.70
5.6.140.0080.02616.79
5.6.130.0080.02616.68
5.6.120.0060.02416.62
5.6.110.0100.02516.61
5.6.100.0050.02916.58
5.6.90.0030.02816.58
5.6.80.0040.02616.39
5.6.70.0060.02716.39
5.6.60.0040.03616.52
5.6.50.0100.02416.50
5.6.40.0070.03116.40
5.6.30.0030.02716.34
5.6.20.0050.02616.37
5.6.10.0070.02216.44
5.6.00.0040.02416.48

preferences:
65.55 ms | 400 KiB | 5 Q