3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Author { private $name; private $id; public function __construct($id, $name = '') { $this->id = $id; $this->name = $name; } public function name() { return $this->name; } public function setName($name) { $this->name = $name; } public function id() { return $this->id; } } class Post { private $id; private $title; private $body; private $author; public function __construct($id, $title, $body, $author) { $this->id = $id; $this->title = $title; $this->body = $body; $this->author = $author; } public function id() { return $this->id; } public function title() { return $this->title; } public function setTitle($title) { $this->title = $title; } public function author() { return $this->author; } public function setAuthor(Author $author) { $this->author = $author; } } $post = new Post(111, 'A Song of Ice and Fire', 'My book is the shiz', new Author(222, 'George RR Martin')); echo $post->author()->name;

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.0040.01416.63
8.3.60.0110.00416.63
8.3.50.0080.00822.98
8.3.40.0130.00619.02
8.3.30.0120.00319.17
8.3.20.0040.00420.13
8.3.10.0000.00821.90
8.3.00.0130.00728.09
8.2.180.0120.00325.92
8.2.170.0110.00419.09
8.2.160.0100.00722.96
8.2.150.0000.00925.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00826.35
8.1.280.0110.00425.92
8.1.270.0070.00024.66
8.1.260.0080.00026.35
8.1.250.0080.00028.09
7.4.10.0160.01016.63
7.4.00.0090.00915.55
7.3.130.0200.00316.46
7.3.120.0110.00515.43
7.3.110.0060.01615.61
7.3.100.0070.01515.79
7.3.90.0080.01115.69
7.3.80.0150.00815.63
7.3.70.0120.00615.46
7.3.60.0090.01315.55
7.3.50.0140.00615.54
7.3.40.0130.00715.60
7.3.30.0090.01115.70
7.3.20.0110.00817.43
7.3.10.0120.01117.25
7.3.00.0100.00917.36
7.2.260.0210.00616.74
7.2.250.0090.01215.90
7.2.240.0120.01215.89
7.2.230.0100.01015.70
7.2.220.0090.00915.73
7.2.210.0090.01315.60
7.2.200.0190.00215.67
7.2.190.0120.00715.81
7.2.180.0110.00915.88
7.2.170.0080.01215.78
7.2.160.0230.00716.71
7.2.150.0170.01418.36
7.2.140.0240.00718.40
7.2.130.0090.02218.47
7.2.120.0250.01118.35
7.2.110.0280.00718.25
7.2.100.0180.01418.26
7.2.90.0170.00813.52
7.2.80.0180.01816.57
7.2.70.0090.02618.39
7.2.60.0140.01117.55
7.2.50.0250.01418.35
7.2.40.0260.00618.38
7.2.30.0130.02218.23
7.2.20.0270.00918.42
7.2.10.0400.01816.48
7.2.00.0180.01518.30
7.1.330.0080.01316.32
7.1.320.0150.00716.25
7.1.310.0250.01216.46
7.1.300.2090.01016.42
7.1.290.0050.01416.44
7.1.280.0120.00916.46
7.1.270.0120.01116.50
7.1.260.0110.00916.47
7.1.250.0160.01017.15
7.1.240.0290.00817.19
7.1.230.0250.00617.13
7.1.220.0190.00817.23
7.1.210.0240.00717.08
7.1.200.0120.00413.70
7.1.190.0450.01415.48
7.1.180.0470.01315.44
7.1.170.0200.00917.09
7.1.160.0150.01717.07
7.1.150.0230.00817.09
7.1.140.0240.00817.19
7.1.130.0250.00317.30
7.1.120.0110.01917.18
7.1.110.0180.01217.29
7.1.100.0080.01717.66
7.1.90.0150.01517.17
7.1.80.0200.01317.22
7.1.70.0160.00917.09
7.1.60.0250.01717.36
7.1.50.0540.00714.21
7.1.40.0540.00612.69
7.1.30.0380.01015.39
7.1.20.0180.00511.65
7.1.10.0220.01117.12
7.1.00.0170.03617.01
7.0.330.0230.00416.84
7.0.320.0210.00716.78
7.0.310.0450.01414.98
7.0.300.0120.01917.01
7.0.290.0190.00816.79
7.0.280.0150.01317.08
7.0.270.0170.01316.86
7.0.260.0200.01016.85
7.0.250.0100.02116.81
7.0.240.0230.00617.09
7.0.230.0170.01016.82
7.0.220.0410.01315.23
7.0.210.0200.01617.00
7.0.200.0120.00816.87
7.0.190.0510.00815.35
7.0.180.0390.00316.88
7.0.170.0390.02115.03
7.0.160.0170.01217.09
7.0.150.0080.01311.65
7.0.140.0280.04216.80
7.0.130.0450.01012.39
7.0.120.0200.00511.65
7.0.110.0350.01315.30
7.0.100.0470.01111.65
7.0.90.0210.01217.08
7.0.80.0190.01216.83
7.0.70.0400.01516.82
7.0.60.0100.04918.48
7.0.50.0120.03017.43
7.0.40.0200.04517.46
7.0.30.0240.03717.44
7.0.20.0160.02617.55
7.0.10.0030.03317.63
7.0.00.0100.03915.85
5.6.400.0180.01515.91
5.6.390.0150.01515.94
5.6.380.0130.01115.64
5.6.370.0200.00815.93
5.6.360.0190.00916.01
5.6.350.0220.00415.95
5.6.340.0170.01716.06
5.6.330.0090.00011.65
5.6.320.0160.00411.65
5.6.310.0200.01216.12
5.6.300.0190.01416.08
5.6.290.0170.01415.99
5.6.280.0170.03618.53
5.6.270.0230.01016.01
5.6.260.0230.00915.75
5.6.250.0220.01316.01
5.6.240.0140.01415.98
5.6.230.0170.00916.05
5.6.220.0200.01315.82
5.6.210.0190.03418.33
5.6.200.0130.03214.90
5.6.190.0100.04716.16
5.6.180.0240.04018.20
5.6.170.0270.04218.05
5.6.160.0110.02618.14
5.6.150.0080.02817.09
5.6.140.0150.04617.15
5.6.130.0120.04617.11
5.6.120.0140.04416.33
5.6.110.0140.04818.51
5.6.100.0080.05118.46
5.6.90.0140.04618.45
5.6.80.0080.03918.02
5.6.70.0150.01515.59
5.6.60.0160.01415.78
5.6.50.0130.01715.79
5.6.40.0130.01715.79
5.6.30.0260.00215.77
5.6.20.0220.00615.96
5.6.10.0100.01011.65
5.6.00.0160.01315.82
5.5.380.0150.01216.00
5.5.370.0140.01415.71
5.5.360.0160.01115.84
5.5.350.2260.02218.13
5.5.340.0090.05116.89
5.5.330.0110.03018.15
5.5.320.0210.04818.01
5.5.310.0190.03118.15
5.5.300.0140.03916.84
5.5.290.0130.03714.80
5.5.280.0180.03518.31
5.5.270.0110.02918.29
5.5.260.0110.04618.22
5.5.250.0190.03418.16
5.5.240.0140.04517.99
5.5.230.0050.02115.58
5.5.220.0170.00815.76
5.5.210.0140.01415.82
5.5.200.0120.01615.85
5.5.190.0130.01315.75
5.5.180.0160.01215.80
5.5.170.0170.01215.65
5.5.160.0160.00815.83
5.5.150.0230.00615.85
5.5.140.0210.00815.80
5.5.130.0230.00615.79
5.5.120.0170.01215.68
5.5.110.0150.01515.86
5.5.100.0110.01615.80
5.5.90.0200.00915.78
5.5.80.0130.01315.84
5.5.70.0140.01415.47
5.5.60.0100.01615.57
5.5.50.0180.01115.50
5.5.40.0180.00715.72
5.5.30.0160.00615.88
5.5.20.0140.01415.82
5.5.10.0160.01115.75
5.5.00.0190.00915.67
5.4.450.1110.02716.15
5.4.440.0930.02616.00
5.4.430.0960.02516.11
5.4.420.0970.02416.02
5.4.410.1100.02816.02
5.4.400.0860.02515.87
5.4.390.1020.02215.83
5.4.380.1100.02815.75
5.4.370.0880.02415.92
5.4.360.0980.02715.80
5.4.350.1010.02715.93
5.4.340.0810.02515.79
5.4.330.0140.00612.70
5.4.320.0980.02015.79
5.4.310.0960.02115.79
5.4.300.0930.02215.63
5.4.290.0890.02415.83
5.4.280.1200.02315.77
5.4.270.0920.01815.94
5.4.260.0940.02015.82
5.4.250.1000.02215.84
5.4.240.1010.01815.83
5.4.230.0970.02215.81
5.4.220.1140.02615.91
5.4.210.1100.02415.83
5.4.200.1050.02415.76
5.4.190.0790.01915.87
5.4.180.1010.01915.86
5.4.170.0980.02315.88
5.4.160.1040.02415.72
5.4.150.0950.02315.93
5.4.140.1040.02914.44
5.4.130.1040.02214.50
5.4.120.0970.02214.50
5.4.110.1040.02714.40
5.4.100.0980.02314.57
5.4.90.0940.02014.32
5.4.80.0960.02314.43
5.4.70.0970.02014.36
5.4.60.1000.02414.45
5.4.50.1170.02214.54
5.4.40.1030.01814.53
5.4.30.1040.02414.45
5.4.20.0990.02014.53
5.4.10.1050.02514.62
5.4.00.1030.02114.30
5.3.290.1130.02014.00
5.3.280.0990.02613.79
5.3.270.0980.02013.91
5.3.260.1050.02813.90
5.3.250.0930.02213.88
5.3.240.1030.02013.70
5.3.230.0910.02413.81
5.3.220.0940.02013.71
5.3.210.1020.02113.65
5.3.200.1050.02313.88
5.3.190.1000.03313.79
5.3.180.1100.02413.87
5.3.170.1050.02813.88
5.3.160.1030.02413.81
5.3.150.1060.02613.85
5.3.140.0920.02213.96
5.3.130.1050.02313.76
5.3.120.1050.02413.82
5.3.110.0880.03113.99
5.3.100.1060.02813.63
5.3.90.0950.03113.55
5.3.80.1060.02613.41
5.3.70.1100.02013.46
5.3.60.0980.01913.49
5.3.50.0970.02413.40
5.3.40.1170.02013.46
5.3.30.0970.01713.42
5.3.20.1080.02013.48
5.3.10.1110.02113.32
5.3.00.1020.02613.20
5.2.170.1670.04311.25
5.2.160.1730.03311.14
5.2.150.1970.03311.09
5.2.140.1500.03011.06
5.2.130.1570.03711.35
5.2.120.1800.02711.24
5.2.110.1730.03011.13
5.2.100.1700.03011.03
5.2.90.1700.03311.03
5.2.80.1500.03011.37
5.2.70.1530.03011.20
5.2.60.1500.02710.98
5.2.50.1770.03011.18
5.2.40.1430.03311.23
5.2.30.1270.02711.07
5.2.20.1430.03011.09
5.2.10.1300.03310.85
5.2.00.0930.03010.64
5.1.60.0070.0209.91
5.1.50.0030.02310.00
5.1.40.0030.0239.89
5.1.30.0000.02710.36
5.1.20.0000.02710.30
5.1.10.1100.0209.99
5.1.00.1200.0239.97
5.0.50.0600.0208.50
5.0.40.0570.0208.58
5.0.30.0600.0308.18
5.0.20.0670.0278.34
5.0.10.0870.0278.27
5.0.00.0630.0278.17
4.4.90.0600.0178.05
4.4.80.0630.0178.05
4.4.70.0700.0178.05
4.4.60.0700.0178.05
4.4.50.0570.0178.05
4.4.40.0800.0278.05
4.4.30.0730.0278.05
4.4.20.0630.0138.05
4.4.10.0770.0208.05
4.4.00.0630.0238.05
4.3.110.0670.0138.05
4.3.100.0670.0138.05
4.3.90.0630.0178.05
4.3.80.0670.0238.05
4.3.70.0630.0178.05
4.3.60.0800.0238.05
4.3.50.0630.0138.05
4.3.40.0600.0208.05
4.3.30.0400.0308.05
4.3.20.0370.0208.05
4.3.10.0500.0238.05
4.3.00.0500.0238.05

preferences:
38.43 ms | 401 KiB | 5 Q