3v4l.org

run code in 300+ PHP versions simultaneously
<?php $bodyMarkdown = <<<'TEXT' "There&#39;s no difference between them in a final class, so use whichever you want. \r\n\r\nBoth calls will return `A`.\r\n```\r\n&lt;?php\r\n\r\nclass Dad {\r\n static function getStatic() {\r\n return new static;\r\n }\r\n \r\n static function getSelf() {\r\n return new self;\r\n }\r\n}\r\n\r\ntrait Useless {\r\n static function getStatic() {\r\n return new static;\r\n }\r\n}\r\n\r\nfinal class A extends Dad {\r\n use Useless;\r\n \r\n static function getSelf() {\r\n return new self;\r\n }\r\n}\r\n\r\nvar_dump(A::getStatic()::class);\r\nvar_dump(A::getSelf()::class);\r\n```\r\n\r\n\r\n\r\n[Example][1]\r\n\r\nhope this helps\r\ndharman\r\n\r\n [1]: https://3v4l.org/CsmAr#v8.0.8" TEXT; $bodyCleansed = json_decode($bodyMarkdown); $username = preg_quote('Dharman', '/'); $re = '/((?<=\.)|\s*^)\s* #space before (I\h)?hope\h(it|this|that) (\hwill\b|\hcan\b)? \hhelps? (\h(you|someone(?:\h*else)?)\b)? (:-?\)|🙂️|[!.;,\s])*? #punctuation and emoji (\s*(cheers|good ?luck)([!,.]*))? # sometimes appears on the same line or next (?:[-~\s]*'.$username.')? $/mix'; $bodyCleansed = preg_replace($re, '', $bodyCleansed, -1, $count); echo($bodyCleansed);

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.0150.00016.63
8.3.60.0170.00718.43
8.3.50.0080.00816.56
8.3.40.0080.00819.14
8.3.30.0090.00618.92
8.3.20.0030.00624.18
8.3.10.0000.00824.66
8.3.00.0110.00726.16
8.2.190.0110.00716.75
8.2.180.0040.01125.92
8.2.170.0110.01119.03
8.2.160.0070.01422.96
8.2.150.0040.00425.66
8.2.140.0000.00924.66
8.2.130.0000.00926.16
8.2.120.0040.00421.19
8.2.110.0170.00722.07
8.2.100.0090.00318.16
8.2.90.0000.00818.93
8.2.80.0030.00517.97
8.2.70.0000.00818.00
8.2.60.0030.00519.88
8.2.50.0080.00018.07
8.2.40.0000.00820.20
8.2.30.0040.00418.16
8.2.20.0000.00818.11
8.2.10.0040.00419.44
8.2.00.0000.00719.43
8.1.280.0000.01525.92
8.1.270.0040.00423.99
8.1.260.0070.00726.35
8.1.250.0040.00428.09
8.1.240.0030.00622.73
8.1.230.0040.00717.89
8.1.220.0000.00817.89
8.1.210.0060.00318.77
8.1.200.0060.00317.38
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0060.00318.71
8.1.160.0070.00018.96
8.1.150.0000.00719.02
8.1.140.0040.00419.02
8.1.130.0040.00420.22
8.1.120.0030.00617.66
8.1.110.0000.00817.68
8.1.100.0050.00317.55
8.1.90.0040.00417.56
8.1.80.0100.00017.70
8.1.70.0000.00717.72
8.1.60.0030.00617.66
8.1.50.0030.00617.69
8.1.40.0000.00817.70
8.1.30.0030.00517.83
8.1.20.0030.00517.92
8.1.10.0060.00317.74
8.1.00.0000.00817.62
8.0.300.0070.00018.77
8.0.290.0040.00416.88
8.0.280.0040.00418.44
8.0.270.0000.00718.20
8.0.260.0000.00718.77
8.0.250.0030.00317.24
8.0.240.0080.00017.12
8.0.230.0020.00517.08
8.0.220.0000.00717.09
8.0.210.0000.00717.17
8.0.200.0000.00717.22
8.0.190.0040.00417.22
8.0.180.0060.00317.22
8.0.170.0000.00817.10
8.0.160.0050.00317.20
8.0.150.0070.00017.05
8.0.140.0100.00017.20
8.0.130.0060.00013.58
8.0.120.0030.00617.14
8.0.110.0040.00417.19
8.0.100.0070.00017.04
8.0.90.0050.00517.21
8.0.80.0070.00317.04
8.0.70.0050.00617.05
8.0.60.0040.00717.11
8.0.50.0030.00616.96
8.0.30.0070.00317.05
8.0.20.0030.00617.05
8.0.10.0100.00017.09
8.0.00.0000.01017.08
7.4.330.0030.00315.55
7.4.320.0060.00316.82
7.4.300.0000.00716.69
7.4.290.0070.00016.75
7.4.280.0040.00416.80
7.4.270.0050.00216.66
7.4.260.0000.00513.43
7.4.250.0080.00016.82
7.4.240.0040.00416.65
7.4.230.0000.00716.61
7.4.220.0000.01016.68
7.4.210.0050.00516.63
7.4.200.0000.00916.53
7.4.190.0070.00316.68
7.4.180.0090.00016.90
7.4.160.0000.00916.83
7.4.150.0030.00616.90
7.4.140.0060.00316.63
7.4.130.0100.00016.72
7.4.120.0030.00616.57
7.4.110.0030.00616.71
7.4.100.0090.00016.89
7.4.90.0090.00016.90
7.4.80.0040.00416.64
7.4.70.0030.00616.63
7.4.60.0030.00616.80
7.4.50.0030.00616.42
7.4.40.0030.00616.72
7.4.30.0060.00316.64
7.4.20.0060.00316.76
7.4.10.0060.00316.56
7.4.00.0030.00616.74
7.3.330.0030.00516.50
7.3.320.0060.00013.39
7.3.310.0030.00316.64
7.3.300.0000.00716.39
7.3.290.0030.00616.43
7.3.280.0030.00716.55
7.3.270.0070.00316.44
7.3.260.0070.00216.51
7.3.250.0040.00416.38
7.3.240.0030.00716.51
7.3.230.0060.00316.46
7.3.220.0100.00016.45
7.3.210.0090.00016.50
7.3.200.0030.00616.43
7.3.190.0060.00316.36
7.3.180.0090.00016.37
7.3.170.0000.00816.27
7.3.160.0000.00916.29
7.3.150.0080.00016.42
7.3.140.0030.00516.36
7.3.130.0030.00616.45
7.3.120.0030.00616.37
7.3.110.0030.00616.36
7.3.100.0030.00616.45
7.3.90.0000.00816.88
7.3.80.0000.00916.57
7.3.70.0080.00016.53
7.3.60.0040.00416.57
7.3.50.0000.00816.41
7.3.40.0000.00816.61
7.3.30.0000.00816.59
7.3.20.0060.00316.54
7.3.10.0030.00616.46
7.3.00.0030.00616.50

preferences:
57.44 ms | 401 KiB | 5 Q