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.0110.00416.50
8.3.50.0110.00416.63
8.3.40.0160.00018.54
8.3.30.0110.00418.84
8.3.20.0040.00420.29
8.3.10.0000.00821.91
8.3.00.0070.00417.38
8.2.180.0120.00316.88
8.2.170.0090.00622.96
8.2.160.0100.00320.46
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00221.11
8.2.120.0070.00026.35
8.2.110.0070.00419.38
8.2.100.0090.00318.16
8.2.90.0000.00819.08
8.2.80.0000.00818.04
8.2.70.0080.00017.50
8.2.60.0000.00917.89
8.2.50.0040.00418.10
8.2.40.0000.00720.39
8.2.30.0040.00421.13
8.2.20.0030.00517.96
8.2.10.0040.00417.96
8.2.00.0000.00718.08
8.1.280.0060.01225.92
8.1.270.0140.00022.25
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0080.00022.54
8.1.230.0090.00317.51
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0030.00617.35
8.1.190.0040.00417.10
8.1.180.0050.00318.10
8.1.170.0040.00418.84
8.1.160.0000.00819.05
8.1.150.0070.00020.53
8.1.140.0030.00619.61
8.1.130.0000.00718.95
8.1.120.0040.00417.55
8.1.110.0030.00617.33
8.1.100.0000.00717.51
8.1.90.0050.00317.53
8.1.80.0040.00417.36
8.1.70.0000.00717.34
8.1.60.0040.00417.50
8.1.50.0000.00717.58
8.1.40.0060.00317.55
8.1.30.0040.00417.57
8.1.20.0000.00817.66
8.1.10.0040.00417.63
8.1.00.0000.00717.50
8.0.300.0110.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00818.58
8.0.270.0030.00317.30
8.0.260.0050.00316.71
8.0.250.0030.00316.96
8.0.240.0030.00316.88
8.0.230.0040.00416.91
8.0.220.0030.00316.81
8.0.210.0040.00416.93
8.0.200.0040.00416.98
8.0.190.0060.00316.91
8.0.180.0000.00716.82
8.0.170.0070.00016.93
8.0.160.0000.00816.95
8.0.150.0000.00716.82
8.0.140.0040.00416.80
8.0.130.0030.00313.29
8.0.120.0040.00416.76
8.0.110.0000.00716.91
8.0.100.0000.00716.90
8.0.90.0030.00516.87
8.0.80.0090.01516.96
8.0.70.0030.00516.79
8.0.60.0060.00316.87
8.0.50.0040.00416.76
8.0.30.0130.00617.08
8.0.20.0100.01017.40
8.0.10.0040.00416.92
8.0.00.0100.01016.77
7.4.330.0040.00415.55
7.4.320.0040.00416.54
7.4.300.0070.00016.52
7.4.290.0030.00516.54
7.4.280.0000.00816.56
7.4.270.0030.00316.44
7.4.260.0070.00316.62
7.4.250.0000.00716.38
7.4.240.0070.00016.63
7.4.230.0030.00316.62
7.4.220.0120.00916.72
7.4.210.0000.01516.50
7.4.200.0000.00816.60
7.4.160.0090.00716.42
7.4.150.0110.00717.40
7.4.140.0130.00717.86
7.4.130.0090.01316.47
7.4.120.0060.01116.49
7.4.110.0110.00616.62
7.4.100.0070.01016.47
7.4.90.0130.00316.38
7.4.80.0150.00819.39
7.4.70.0120.00916.60
7.4.60.0030.01716.54
7.4.50.0060.00916.57
7.4.40.0030.01316.50
7.4.30.0120.01016.45
7.4.00.0000.01515.23
7.3.330.0060.00313.13
7.3.320.0000.00513.15
7.3.310.0070.00016.38
7.3.300.0000.00716.19
7.3.290.0070.00616.36
7.3.280.0110.00816.31
7.3.270.0090.00917.40
7.3.260.0140.00416.25
7.3.250.0110.00916.31
7.3.240.0130.00916.30
7.3.230.0120.00916.30
7.3.210.0100.00716.59
7.3.200.0030.01316.57
7.3.190.0100.00616.27
7.3.180.0090.00916.33
7.3.170.0090.00616.45
7.3.160.0040.01116.49
7.3.10.0110.00316.33
7.3.00.0100.01015.95
7.2.330.0120.00616.55
7.2.320.0070.01116.72
7.2.310.0080.00816.67
7.2.300.0040.01616.75
7.2.290.0070.01016.72
7.2.130.0100.00516.41
7.2.120.0080.00816.21
7.2.110.0060.00916.14
7.2.100.0080.01216.46
7.2.90.0140.00716.42
7.2.80.0110.00716.45
7.2.70.0090.00916.28
7.2.60.0080.00816.65
7.2.50.0190.00416.43
7.2.40.0000.01816.64
7.2.30.0090.01216.36
7.2.20.0150.00415.98
7.2.10.0110.01116.13
7.2.00.0130.00517.99
7.1.250.0080.00815.12
7.1.200.0000.01315.66
7.1.100.0110.00318.36
7.1.70.0080.00617.07
7.1.60.0180.01134.77
7.1.50.0250.00634.82
7.1.40.0150.01534.36
7.1.30.0130.01734.62
7.1.20.0220.00934.51
7.1.10.0100.00616.30
7.1.00.0030.01216.63
7.0.200.0000.01316.70
7.0.190.0030.01016.74
7.0.180.0070.00716.26
7.0.170.0040.01116.00
7.0.160.0030.01016.28
7.0.150.0030.01216.22
7.0.140.0060.00916.32
7.0.130.0070.01416.63
7.0.120.0090.00616.35
7.0.110.0070.00716.33
7.0.100.0000.01316.19
7.0.90.0030.01016.29
7.0.80.0030.01016.40
7.0.70.0030.01016.20
7.0.60.0050.00815.89
7.0.50.0100.00316.24
7.0.40.0100.00316.32
7.0.30.0080.00816.49
7.0.20.0080.00816.39
7.0.10.0000.01516.36
7.0.00.0070.00716.39

preferences:
44.69 ms | 400 KiB | 5 Q