3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { const TABLE = 'posts'; const TYPE = 'post'; static public function all() { $select = "SELECT * FROM `%s` WHERE `type` = '%s'\n"; echo sprintf($select, self::TABLE, self::TYPE); } } Post::all(); class Comment extends Post { const TYPE = 'comment'; } Comment::all(); echo "===\n';"; class PostA { const TABLE = 'posts'; const TYPE = 'post'; static public function all() { $select = "SELECT * FROM `%s` WHERE `type` = '%s'\n"; echo sprintf($select, static::TABLE, static::TYPE); } } PostA::all(); // SELECT * FROM `posts` WHERE `type` = 'post' class CommentA extends PostA { const TYPE = 'comment'; } CommentA::all();

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.0040.01116.63
8.3.50.0150.00016.34
8.3.40.0090.00618.75
8.3.30.0110.00418.70
8.3.20.0000.00820.34
8.3.10.0030.00521.85
8.3.00.0080.00017.46
8.2.180.0120.00316.38
8.2.170.0130.00322.96
8.2.160.0050.00920.39
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00421.00
8.2.120.0000.00726.35
8.2.110.0090.00019.24
8.2.100.0000.01118.22
8.2.90.0050.00319.08
8.2.80.0080.00017.97
8.2.70.0040.00417.25
8.2.60.0040.00417.93
8.2.50.0050.00318.10
8.2.40.0040.00420.42
8.2.30.0000.00820.97
8.2.20.0000.00818.08
8.2.10.0000.00718.00
8.2.00.0050.00218.08
8.1.280.0210.00025.92
8.1.270.0060.01222.14
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0030.00622.49
8.1.230.0110.00317.45
8.1.220.0060.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0000.00917.23
8.1.180.0060.00318.10
8.1.170.0030.00518.99
8.1.160.0070.00019.04
8.1.150.0000.00820.61
8.1.140.0030.00719.53
8.1.130.0070.00018.93
8.1.120.0000.00817.51
8.1.110.0030.00617.45
8.1.100.0030.00517.43
8.1.90.0040.00417.48
8.1.80.0000.00717.37
8.1.70.0050.00217.45
8.1.60.0000.00817.60
8.1.50.0050.00317.56
8.1.40.0000.00817.52
8.1.30.0060.00317.63
8.1.20.0030.00617.65
8.1.10.0050.00317.56
8.1.00.0020.00517.43
8.0.300.0050.00518.77
8.0.290.0080.00016.58
8.0.280.0030.00518.39
8.0.270.0030.00517.20
8.0.260.0000.00616.74
8.0.250.0000.00716.91
8.0.240.0040.00416.87
8.0.230.0000.00717.04
8.0.220.0080.00016.90
8.0.210.0030.00316.93
8.0.200.0050.00216.86
8.0.190.0060.00316.96
8.0.180.0040.00416.84
8.0.170.0070.00016.84
8.0.160.0060.00316.93
8.0.150.0000.00716.91
8.0.140.0040.00416.87
8.0.130.0060.00013.30
8.0.120.0040.00416.91
8.0.110.0040.00416.90
8.0.100.0060.00216.95
8.0.90.0020.00516.81
8.0.80.0080.00816.91
8.0.70.0050.00316.76
8.0.60.0000.00716.90
8.0.50.0070.00016.81
8.0.30.0090.01117.11
8.0.20.0100.00917.40
8.0.10.0000.00916.93
8.0.00.0070.01017.02
7.4.330.0030.00315.55
7.4.320.0030.00316.50
7.4.300.0030.00316.63
7.4.290.0030.00316.52
7.4.280.0080.00016.51
7.4.270.0040.00416.53
7.4.260.0000.00716.61
7.4.250.0000.00716.59
7.4.240.0000.00716.55
7.4.230.0030.00316.48
7.4.220.0110.00616.49
7.4.210.0080.01116.61
7.4.200.0040.00416.55
7.4.160.0050.01316.54
7.4.150.0140.00317.40
7.4.140.0120.00717.86
7.4.130.0090.00916.46
7.4.120.0050.01616.51
7.4.110.0160.00416.55
7.4.100.0030.01716.43
7.4.90.0110.01116.61
7.4.80.0060.01419.39
7.4.70.0120.00916.58
7.4.60.0100.00616.44
7.4.50.0060.00916.55
7.4.40.0060.01016.57
7.4.30.0100.01316.55
7.4.00.0000.01414.88
7.3.330.0050.00313.33
7.3.320.0050.00013.32
7.3.310.0000.00716.35
7.3.300.0040.00416.14
7.3.290.0070.00716.30
7.3.280.0130.00716.31
7.3.270.0080.00817.40
7.3.260.0120.00516.28
7.3.250.0090.01016.41
7.3.240.0140.00716.33
7.3.230.0060.01216.59
7.3.210.0070.01316.20
7.3.200.0030.01716.26
7.3.190.0100.00716.39
7.3.180.0060.01016.23
7.3.170.0090.00616.61
7.3.160.0120.00416.35
7.2.330.0090.00916.46
7.2.320.0110.01116.63
7.2.310.0100.00616.66
7.2.300.0130.00316.74
7.2.290.0050.01016.68
7.2.60.0030.01016.84
7.2.00.0040.00819.44
7.1.200.0080.00615.69
7.1.100.0060.00917.63
7.1.70.0030.01017.08
7.1.60.0210.00935.17
7.1.50.0260.00734.77
7.1.40.0170.01334.26
7.1.30.0180.01234.34
7.1.20.0180.01434.38
7.1.10.0080.00616.42
7.1.00.0000.01416.82
7.0.200.0040.00916.64
7.0.190.0090.00616.57
7.0.180.0060.00916.28
7.0.170.0070.00716.28
7.0.160.0130.00816.20
7.0.150.0040.01116.18
7.0.140.0080.00816.22
7.0.130.0060.01316.45
7.0.120.0060.00916.30
7.0.110.0070.00716.47
7.0.100.0100.00316.30
7.0.90.0060.00616.02
7.0.80.0100.00616.46
7.0.70.0070.00716.31
7.0.60.0080.00815.98
7.0.50.0070.00716.21
7.0.40.0080.00416.26
7.0.30.0000.01316.18
7.0.20.0000.01416.31
7.0.10.0030.01016.30
7.0.00.0070.01016.36

preferences:
54.17 ms | 401 KiB | 5 Q