3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Album\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; use Album\Model\Album; use Album\Form\AlbumForm; class AlbumController extends AbstractActionController { protected $albumTable; public function indexAction() { return new ViewModel(array( 'albums' => $this->getAlbumTable()->fetchAll(), )); } public function addAction() { $form = new AlbumForm(); $form->get('submit')->setAttribute('value', 'Add'); $request = $this->getRequest(); if ($request->isPost()) { $album = new Album(); $form->setInputFilter($album->getInputFilter()); $form->setData($request->getPost()); if ($form->isValid()) { $album->exchangeArray($form->getData()); $this->getAlbumTable()->saveAlbum($album); // Redirect to list of albums return $this->redirect()->toRoute('album'); } } return array('form' => $form); } public function editAction() { $id = (int)$this->params('id'); if (!$id) { return $this->redirect()->toRoute('album', array('action'=>'add')); } $album = $this->getAlbumTable()->getAlbum($id); $form = new AlbumForm(); $form->bind($album); $form->get('submit')->setAttribute('value', 'Edit'); $request = $this->getRequest(); if ($request->isPost()) { $form->setData($request->getPost()); if ($form->isValid()) { $this->getAlbumTable()->saveAlbum($album); // Redirect to list of albums return $this->redirect()->toRoute('album'); } } return array( 'id' => $id, 'form' => $form, ); } public function deleteAction() { $id = (int)$this->params('id'); if (!$id) { return $this->redirect()->toRoute('album'); } $request = $this->getRequest(); if ($request->isPost()) { $del = $request->getPost()->get('del', 'No'); if ($del == 'Yes') { $id = (int)$request->getPost()->get('id'); $this->getAlbumTable()->deleteAlbum($id); } // Redirect to list of albums return $this->redirect()->toRoute('album'); } return array( 'id' => $id, 'album' => $this->getAlbumTable()->getAlbum($id) ); } public function getAlbumTable() { if (!$this->albumTable) { $sm = $this->getServiceLocator(); $this->albumTable = $sm->get('Album\Model\AlbumTable'); } return $this->albumTable; } }

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.0160.00018.52
8.3.50.0140.00321.14
8.3.40.0100.00718.83
8.3.30.0000.01418.91
8.3.20.0000.00918.79
8.3.10.0040.00418.94
8.3.00.0070.00023.61
8.2.180.0090.00617.00
8.2.170.0210.00022.96
8.2.160.0070.00720.39
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.64
8.2.110.0060.00320.53
8.2.100.0090.00317.84
8.2.90.0000.00819.23
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00817.91
8.2.50.0000.00818.07
8.2.40.0060.00318.09
8.2.30.0070.00019.48
8.2.20.0000.00717.82
8.2.10.0000.00717.80
8.2.00.0030.00617.86
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0060.00322.41
8.1.230.0000.01121.04
8.1.220.0060.00318.77
8.1.210.0040.00418.94
8.1.200.0000.00917.24
8.1.190.0040.00417.40
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0000.00718.94
8.1.150.0040.00418.54
8.1.140.0040.00417.52
8.1.130.0030.00317.79
8.1.120.0030.00717.45
8.1.110.0000.00817.32
8.1.100.0040.00417.43
8.1.90.0030.00317.33
8.1.80.0040.00417.49
8.1.70.0030.00317.41
8.1.60.0000.00817.61
8.1.50.0000.00917.35
8.1.40.0090.00017.53
8.1.30.0000.00717.57
8.1.20.0040.00417.59
8.1.10.0080.00017.54
8.1.00.0000.00717.34
8.0.300.0070.00019.96
8.0.290.0000.00717.05
8.0.280.0050.00318.48
8.0.270.0030.00317.29
8.0.260.0000.00716.95
8.0.250.0040.00417.01
8.0.240.0030.00617.03
8.0.230.0030.00317.11
8.0.220.0000.00816.89
8.0.210.0040.00417.03
8.0.200.0030.00317.03
8.0.190.0030.00517.07
8.0.180.0040.00416.88
8.0.170.0080.00016.90
8.0.160.0050.00316.83
8.0.150.0040.00416.83
8.0.140.0050.00216.82
8.0.130.0060.00013.41
8.0.120.0070.00016.96
8.0.110.0040.00416.82
8.0.100.0000.00716.80
8.0.90.0000.00716.99
8.0.80.0070.01116.98
8.0.70.0000.00716.89
8.0.60.0050.00216.89
8.0.50.0040.00417.01
8.0.30.0100.00917.04
8.0.20.0130.00617.40
8.0.10.0000.00716.83
8.0.00.0100.00916.85
7.4.330.0050.00014.71
7.4.320.0000.00616.43
7.4.300.0000.00716.57
7.4.290.0070.00016.44
7.4.280.0030.00316.53
7.4.270.0070.00016.58
7.4.260.0060.00013.29
7.4.250.0030.00516.47
7.4.240.0070.00016.54
7.4.230.0000.00716.47
7.4.220.0100.01016.60
7.4.210.0070.00716.53
7.4.200.0070.00016.47
7.4.190.0000.00716.43
7.4.160.0140.00916.45
7.4.150.0090.00917.40
7.4.140.0080.01217.86
7.4.130.0110.00816.51
7.4.120.0090.01116.42
7.4.110.0100.00916.58
7.4.100.0030.01616.45
7.4.90.0060.01216.63
7.4.80.0140.00619.39
7.4.70.0060.00916.45
7.4.60.0190.00016.56
7.4.50.0040.00416.19
7.4.40.0030.01322.52
7.4.30.0070.01016.61
7.4.00.0000.01514.91
7.3.330.0000.00513.37
7.3.320.0040.00413.36
7.3.310.0040.00416.34
7.3.300.0030.00316.36
7.3.290.0100.01016.34
7.3.280.0100.00716.33
7.3.270.0170.00017.40
7.3.260.0090.00818.24
7.3.250.0090.01116.48
7.3.240.0130.00316.33
7.3.230.0100.00716.43
7.3.210.0140.00316.62
7.3.200.0080.01219.39
7.3.190.0100.00716.54
7.3.180.0030.01416.32
7.3.170.0120.00916.63
7.3.160.0080.00816.48
7.3.120.0060.00914.76
7.3.00.0110.00416.61
7.2.330.0090.00916.66
7.2.320.0130.01016.62
7.2.310.0090.00916.79
7.2.300.0100.01016.68
7.2.290.0070.01016.72
7.2.130.0090.00416.77
7.2.120.0100.00716.87
7.2.110.0000.01416.91
7.2.100.0060.00616.72
7.2.90.0040.00816.38
7.2.80.0030.01416.46
7.2.70.0070.00716.79
7.2.60.0020.01216.62
7.2.50.0000.01516.81
7.2.40.0090.00016.75
7.2.30.0110.00416.83
7.2.20.0080.00416.74
7.2.10.0090.00616.89
7.2.00.0060.00817.98
7.1.250.0040.00815.58
7.1.240.0040.00715.54
7.1.230.0030.00515.36
7.1.220.0000.01115.43
7.1.210.0070.00315.55
7.1.200.0060.00415.68
7.1.190.0130.00315.67
7.1.180.0030.01315.39
7.1.170.0030.01015.81
7.1.160.0000.01315.65
7.1.150.0060.00915.45
7.1.140.0030.00815.69
7.1.130.0070.00415.52
7.1.120.0080.00015.52
7.1.110.0080.00315.63
7.1.100.0030.01016.55
7.1.90.0000.01115.21
7.1.80.0070.00415.29
7.1.70.0080.00116.20
7.1.60.0100.00717.58
7.1.50.0060.00816.31
7.1.40.0070.00715.62
7.1.30.0140.00015.70
7.1.20.0050.00315.39
7.1.10.0000.01415.57
7.1.00.0050.04218.84
7.0.330.0070.00314.96
7.0.320.0000.00914.99
7.0.310.0030.00515.41
7.0.300.0030.00915.16
7.0.290.0060.00915.34
7.0.280.0030.00615.12
7.0.270.0060.00914.95
7.0.260.0050.00815.20
7.0.250.0040.00415.17
7.0.240.0100.00315.43
7.0.230.0100.00615.25
7.0.220.0000.01015.08
7.0.210.0030.00615.39
7.0.200.0040.00415.94
7.0.190.0000.01315.47
7.0.180.0050.00515.15
7.0.170.0030.00615.49
7.0.160.0040.01115.25
7.0.150.0000.01215.38
7.0.140.0030.03818.80
7.0.130.0000.00815.02
7.0.120.0040.00715.08
7.0.110.0080.00015.34
7.0.100.0080.00515.19
7.0.90.0040.00415.32
7.0.80.0060.00615.39
7.0.70.0050.04218.43
7.0.60.0090.04018.47
7.0.50.0020.02918.74
7.0.40.0030.02516.71
7.0.30.0030.03616.53
7.0.20.0040.02416.63
7.0.10.0040.02516.71
7.0.00.0050.02216.64
5.6.380.0070.00714.27
5.6.370.0040.01214.38
5.6.360.0030.00914.24
5.6.350.0000.01114.04
5.6.340.0060.00314.12
5.6.330.0030.00814.30
5.6.320.0070.00714.34
5.6.310.0110.00014.14
5.6.300.0000.01413.98
5.6.290.0030.00914.11
5.6.280.0060.03817.66
5.6.270.0100.00314.07
5.6.260.0030.00714.20
5.6.250.0100.00314.22
5.6.240.0000.01114.10
5.6.230.0120.00414.41
5.6.220.0020.04717.38
5.6.210.0050.03117.48
5.6.200.0030.04017.70
5.6.190.0030.03517.69
5.6.180.0030.02517.64
5.6.170.0020.02417.62
5.6.160.0020.03717.58
5.6.150.0020.02517.47
5.6.140.0070.04217.61
5.6.130.0010.02617.69
5.6.120.0080.02817.59
5.6.110.0070.02217.52
5.6.100.0030.02617.54
5.6.90.0060.02417.61
5.6.80.0030.03017.17
5.6.70.0020.02117.18
5.6.60.0030.02017.16
5.6.50.0030.02317.23
5.6.40.0020.02417.22
5.6.30.0040.01817.20
5.6.20.0040.02517.35
5.6.10.0050.02017.35
5.6.00.0020.02617.24
5.5.380.0080.00011.18
5.5.370.0030.00611.18
5.5.360.0080.03215.78
5.5.350.0070.04015.81
5.5.340.0080.01816.05
5.5.330.0050.02416.04
5.5.320.0030.02316.02
5.5.310.0060.02815.99
5.5.300.0070.02116.00
5.5.290.0000.02516.07
5.5.280.0080.03816.03
5.5.270.0000.02516.06
5.5.260.0050.03016.03
5.5.250.0020.02015.96
5.5.240.0040.01615.61
5.5.230.0020.01815.74
5.5.220.0050.02315.73
5.5.210.0020.03215.65
5.5.200.0010.02315.60
5.5.190.0030.02015.60
5.5.180.0020.02115.72
5.5.170.0000.01011.18
5.5.160.0000.02915.73
5.5.150.0060.01715.72
5.5.140.0020.02515.67
5.5.130.0020.02215.66
5.5.120.0020.02315.72
5.5.110.0000.02415.72
5.5.100.0050.02515.67
5.5.90.0000.04815.61
5.5.80.0020.04315.65
5.5.70.0020.04615.58
5.5.60.0030.03915.68
5.5.50.0060.04315.63
5.5.40.0040.03815.60
5.5.30.0060.02615.56
5.5.20.0060.04015.58
5.5.10.0070.04015.62
5.5.00.0040.04015.62
5.4.450.0000.02515.20
5.4.440.0030.04115.30
5.4.430.0030.02115.20
5.4.420.0040.01815.17
5.4.410.0020.03215.11
5.4.400.0030.02115.04
5.4.390.0030.02215.13
5.4.380.0030.02015.04
5.4.370.0040.02015.06
5.4.360.0040.02015.18
5.4.350.0060.03515.16
5.4.340.0050.03515.21
5.4.330.0060.00611.18
5.4.320.0030.02015.19
5.4.310.0020.02215.17
5.4.300.0020.02215.06
5.4.290.0020.02015.18
5.4.280.0050.01815.11
5.4.270.0040.02315.14
5.4.260.0050.01815.07
5.4.250.0060.03315.15
5.4.240.0050.03215.20
5.4.230.0020.04415.11
5.4.220.0050.03715.11
5.4.210.0030.04015.13
5.4.200.0050.04315.20
5.4.190.0020.03115.01
5.4.180.0030.03815.10
5.4.170.0010.04515.11
5.4.160.0050.03915.00
5.4.150.0080.03515.00
5.4.140.0030.04113.70
5.4.130.0000.04413.80
5.4.120.0000.03313.82
5.4.110.0060.02813.83
5.4.100.0010.02813.77
5.4.90.0080.01813.84
5.4.80.0060.03513.77
5.4.70.0050.03813.80
5.4.60.0030.03813.76
5.4.50.0020.02413.83
5.4.40.0000.04213.80
5.4.30.0050.03913.77
5.4.20.0020.04113.79
5.4.10.0020.03213.74
5.4.00.0030.04313.53
5.3.290.0010.01912.91
5.3.280.0050.03712.90
5.3.270.0060.03812.95
5.3.260.0030.04212.89
5.3.250.0030.04012.98
5.3.240.0030.04012.97
5.3.230.0000.03012.91
5.3.220.0020.04012.92
5.3.210.0070.03812.91
5.3.200.0020.03512.88
5.3.190.0040.04112.90
5.3.180.0060.03712.91
5.3.170.0030.04112.94
5.3.160.0030.03012.88
5.3.150.0050.02612.92
5.3.140.0070.03912.94
5.3.130.0030.03312.91
5.3.120.0030.04012.91
5.3.110.0030.02812.86
5.3.100.0030.04212.66
5.3.90.0020.04012.66
5.3.80.0030.03312.63
5.3.70.0000.03512.64
5.3.60.0060.03312.63
5.3.50.0040.03412.59
5.3.40.0050.01812.53
5.3.30.0000.02812.50
5.3.20.0020.03812.48
5.3.10.0050.03312.39
5.3.00.0040.03912.43
5.2.170.0020.03611.67
5.2.160.0050.02111.67
5.2.150.0030.03711.67
5.2.140.0010.03311.67
5.2.130.0070.03011.67
5.2.120.0050.03311.67
5.2.110.0030.02811.67
5.2.100.0030.02511.67
5.2.90.0060.02811.67
5.2.80.0080.03211.67
5.2.70.0000.02911.67
5.2.60.0030.02011.67
5.2.50.0040.03111.67
5.2.40.0020.03011.67
5.2.30.0020.02911.67
5.2.20.0020.02511.67
5.2.10.0000.03511.67
5.2.00.0050.03211.67
5.1.60.0040.02711.67
5.1.50.0040.03011.67
5.1.40.0020.03211.67
5.1.30.0000.03211.67
5.1.20.0020.03211.67
5.1.10.0010.03111.67
5.1.00.0040.02911.67
5.0.50.0030.02011.67
5.0.40.0040.02211.67
5.0.30.0050.03311.67
5.0.20.0040.02311.67
5.0.10.0030.02311.67
5.0.00.0030.03811.67
4.4.90.0010.01311.67
4.4.80.0000.01111.67
4.4.70.0020.01311.67
4.4.60.0000.01911.67
4.4.50.0020.01811.67
4.4.40.0000.02311.67
4.4.30.0030.01311.67
4.4.20.0000.01911.67
4.4.10.0030.02011.67
4.4.00.0050.02511.67
4.3.110.0010.01911.67
4.3.100.0030.01711.67
4.3.90.0000.02211.67
4.3.80.0020.02911.67
4.3.70.0000.02011.67
4.3.60.0000.01911.67
4.3.50.0000.01811.67
4.3.40.0030.01811.67
4.3.30.0020.01111.67
4.3.20.0040.01111.67
4.3.10.0030.01111.67
4.3.00.0020.01011.67

preferences:
42.66 ms | 401 KiB | 5 Q