3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace AdminModule; use Nette\Application\UI; /** * Description of InvoiceDateForm * * @author Richard Kapička, http://richard.kapicka.cz * @copyright 2014 */ class InvoiceDateForm extends UI\Form { /** * @var \AdminModule\Models\InvoiceModel */ private $invoiceModel; /** * @var \AdminModule\Models\ProjectModel( */ private $projectModel; /** * @var \Xprom\FlexiBee */ private $flexiBee; /** * @param \AdminModule\Models\InvoiceModel * @param \AdminModule\Models\ProjectModel * @param \Xprom\FlexiBee */ public function __construct(\AdminModule\Models\InvoiceModel $im, \AdminModule\Models\ProjectModel $pm, \Xprom\FlexiBee $fb) { parent::__construct(); $this->invoiceModel = $im; $this->projectModel = $pm; $this->flexiBee = $fb; } /** * @return \Nette\Forms\Form */ public function builForm() { $form = $this->form; $_this = $this; $form->addDynamic('projects', function(\Nette\Forms\Container $container) use($_this) { $container->addHidden('id'); $container->addHidden('phaseId'); $container->addDatePicker('date_transfer') ->controlPrototype->class('input-small no-margin'); $container->addSubmit('submit', 'Převést') ->onClick[] = $_this->formSuccess; $container['submit']->controlPrototype->class('btn btn-success'); }, 1); return $form; } /** * @param \Nette\Forms\Controls\SubmitButton */ public function formSuccess(\Nette\Forms\Controls\SubmitButton $button) { $values = $button->form->getValues(); $errors = array(); if (isset($values->projects->{$button->parent->name}) && !empty($values->projects->{$button->parent->name}->date_transfer)) { $section = $values->projects->{$button->parent->name}; $pr = $this->projectModel->getProjectByPhaseId($section->phaseId); $phase = $this->projectModel->getPhaseById($section->phaseId); if (!is_null($phase->date_invoice_transfer) && $phase->date_invoice_transfer->format('Y-m-d') >= $section->date_transfer->format('Y-m-d')) { $errors[] = 'Datum převodu musí být větší než datum posledního převodu!'; } else { // This is first invoice for this phase if (is_null($phase->date_invoice_transfer)) { // Only on firt invoice set SDZ && VDZ (signs pay by amount) // Create FlexiBee record $fbResult = $this->flexiBee->addOrder( $phase->id, $pr->number, $pr->name, $pr->place, $pr->note, $pr->bil_name, $pr->bil_street, $pr->bil_city, $pr->bil_postcode, $pr->bil_cin, $pr->bil_tin, array('pdz', 'sdz', 'vdz'), NULL, $section->date_transfer ); } else { // Create FlexiBee record $fbResult = $this->flexiBee->addOrder( $phase->id, $pr->number, $pr->name, $pr->place, $pr->note, $pr->bil_name, $pr->bil_street, $pr->bil_city, $pr->bil_postcode, $pr->bil_cin, $pr->bil_tin, array('pdz'), $phase->date_invoice_transfer, $section->date_transfer ); } if ($fbResult === TRUE) { $this->invoiceModel->setDateInvoiceTransferBy($section->date_transfer, array('id_project' => $pr->id, 'id' => $phase->id)); } else { $errors[] = 'FlexiBee převod nebyl uskutečněn, jelikož dané období neobsahuje žádná data.'; } } } if (count($errors)) { foreach ($errors as $error) { $button->form->addError((string) $error); } } else { $this->presenter->redirect('this'); } } }

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.0150.00718.30
8.3.50.0120.00722.11
8.3.40.0110.00718.79
8.3.30.0040.01119.18
8.3.20.0040.00420.35
8.3.10.0030.00522.09
8.3.00.0040.00422.46
8.2.180.0110.00418.29
8.2.170.0030.01222.96
8.2.160.0030.01020.93
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0050.00319.36
8.2.110.0050.00522.07
8.2.100.0070.00717.78
8.2.90.0050.00319.22
8.2.80.0030.00517.97
8.2.70.0060.00317.75
8.2.60.0030.00617.92
8.2.50.0000.00918.07
8.2.40.0060.00318.22
8.2.30.0050.00518.04
8.2.20.0040.00417.72
8.2.10.0040.00417.80
8.2.00.0060.00317.68
8.1.280.0090.01225.92
8.1.270.0040.00422.02
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0070.00419.22
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00717.35
8.1.190.0090.00017.63
8.1.180.0040.00418.10
8.1.170.0040.00418.62
8.1.160.0040.00422.09
8.1.150.0080.00018.70
8.1.140.0000.00817.45
8.1.130.0040.00417.82
8.1.120.0070.00317.36
8.1.110.0030.00517.48
8.1.100.0050.00217.45
8.1.90.0050.00217.37
8.1.80.0040.00417.41
8.1.70.0030.00317.37
8.1.60.0050.00517.57
8.1.50.0040.00417.55
8.1.40.0080.00017.55
8.1.30.0000.00817.61
8.1.20.0030.00617.66
8.1.10.0040.00417.57
8.1.00.0050.00217.42
8.0.300.0040.00418.77
8.0.290.0080.00017.16
8.0.280.0040.00418.48
8.0.270.0070.00017.36
8.0.260.0030.00316.86
8.0.250.0000.00716.99
8.0.240.0050.00317.12
8.0.230.0070.00016.93
8.0.220.0080.00016.94
8.0.210.0030.00316.99
8.0.200.0040.00417.12
8.0.190.0040.00416.98
8.0.180.0000.00817.00
8.0.170.0040.00416.98
8.0.160.0060.00317.05
8.0.150.0030.00417.02
8.0.140.0050.00216.88
8.0.130.0030.00313.45
8.0.120.0040.00417.10
8.0.110.0040.00417.00
8.0.100.0040.00417.01
8.0.90.0000.00817.14
8.0.80.0030.01717.07
8.0.70.0000.00717.14
8.0.60.0000.00817.08
8.0.50.0050.00216.92
8.0.30.0160.00617.23
8.0.20.0080.01017.40
8.0.10.0000.00717.09
8.0.00.0090.01116.86
7.4.330.0050.00015.00
7.4.320.0000.00616.51
7.4.300.0030.00316.61
7.4.290.0000.00716.63
7.4.280.0030.00316.49
7.4.270.0060.00316.47
7.4.260.0070.00016.59
7.4.250.0070.00016.46
7.4.240.0030.00316.57
7.4.230.0000.00716.61
7.4.220.0080.01116.56
7.4.210.0050.01116.61
7.4.200.0030.00316.61
7.4.190.0040.00416.48
7.4.160.0150.00016.54
7.4.150.0170.00017.40
7.4.140.0120.00717.86
7.4.130.0110.00616.60
7.4.120.0080.01516.49
7.4.110.0070.01016.54
7.4.100.0100.01016.52
7.4.90.0080.00916.61
7.4.80.0110.00719.39
7.4.70.0100.00616.67
7.4.60.0030.01416.78
7.4.50.0050.00016.41
7.4.40.0060.01022.77
7.4.30.0000.01616.61
7.4.00.0130.00315.10
7.3.330.0000.00613.39
7.3.320.0030.00313.24
7.3.310.0000.00716.26
7.3.300.0000.00716.37
7.3.290.0080.00516.38
7.3.280.0070.01116.35
7.3.270.0070.01017.40
7.3.260.0210.00616.61
7.3.250.0100.00716.49
7.3.240.0030.01316.49
7.3.230.0070.01016.64
7.3.210.0120.00616.63
7.3.200.0070.01619.39
7.3.190.0180.00316.35
7.3.180.0070.01016.63
7.3.170.0060.01016.38
7.3.160.0090.00616.36
7.3.120.0030.01314.73
7.2.330.0060.01216.69
7.2.320.0100.00716.45
7.2.310.0060.01616.39
7.2.300.0170.00016.46
7.2.290.0080.00816.44
7.2.60.0120.00416.50
7.2.00.0030.01419.26
7.1.200.0030.01015.42
7.1.100.0000.01117.70
7.1.70.0000.01017.03
7.1.60.0140.01019.82
7.1.50.0070.00716.54
7.1.00.0030.07322.45
7.0.200.0070.00316.54
7.0.140.0000.07722.12
7.0.60.0200.07019.87
7.0.50.0100.08017.93
7.0.40.0070.09720.13
7.0.30.0330.07320.21
7.0.20.0330.06020.06
7.0.10.0070.09020.19
7.0.00.0030.08020.09
5.6.280.0030.07320.90
5.6.210.0130.07320.52
5.6.200.0030.07018.28
5.6.190.0130.08020.50
5.6.180.3730.04320.59
5.6.170.0300.06320.54
5.6.160.0030.05020.56
5.6.150.0070.05318.31
5.6.140.0130.07318.20
5.6.130.0000.06018.20
5.6.120.0030.04021.16
5.6.110.0070.08720.99
5.6.100.0100.07321.02
5.6.90.0030.04021.16
5.6.80.0100.08320.39
5.5.350.0230.04720.45
5.5.340.0100.05018.10
5.5.330.0070.08020.47
5.5.320.0200.03720.52
5.5.310.0370.06720.38
5.5.300.0100.07318.11
5.5.290.0000.04318.01
5.5.280.0170.07720.91
5.5.270.0100.05320.90
5.5.260.0100.06720.91
5.5.250.0030.08320.68
5.5.240.0030.08020.16
5.4.450.1230.03319.32
5.4.440.0370.03719.48
5.4.430.0170.03319.38
5.4.420.0730.05019.38
5.4.410.0470.04019.42
5.4.400.0930.04019.23
5.4.390.0400.03718.98
5.4.380.0400.05718.62
5.4.370.0400.05318.60
5.4.360.0430.05018.48
5.4.350.0370.05018.83
5.4.340.0300.05018.75
5.4.320.0090.03812.57
5.4.310.0070.03712.57
5.4.300.0070.03712.57
5.4.290.0060.03912.57
5.4.280.0050.03812.46
5.4.270.0050.04212.46
5.4.260.0100.05318.95
5.4.250.0030.06018.76
5.4.240.0100.06318.79
5.4.230.0170.06318.76
5.4.220.0070.05318.98
5.4.210.0100.04718.94
5.4.200.0130.04718.65
5.4.190.0070.05319.08
5.4.180.0170.06018.98
5.4.170.0100.05318.75
5.4.160.0100.05718.99
5.4.150.0170.05718.61
5.4.140.0070.07316.47
5.4.130.0100.07016.49
5.4.120.0100.05316.52
5.4.110.0070.05316.52
5.4.100.0000.06716.40
5.4.90.0070.06716.40
5.4.80.0030.05016.60
5.4.70.0070.04716.52
5.4.60.0030.07316.54
5.4.50.0170.06316.63
5.4.40.0100.05016.57
5.4.30.0070.05016.28
5.4.20.0100.05016.43
5.4.10.0070.05016.47
5.4.00.0030.05315.82
5.3.290.0140.04212.80
5.3.280.0030.05314.65
5.3.270.0070.05314.70
5.3.260.0230.05714.64
5.3.250.0000.07714.63
5.3.240.0130.06314.66
5.3.230.0030.05314.82
5.3.220.0330.04714.74
5.3.210.0030.07714.82
5.3.200.0070.06714.73
5.3.190.0070.05014.58
5.3.180.0100.04714.52
5.3.170.0100.05014.50
5.3.160.0200.06014.82
5.3.150.0000.05714.60
5.3.140.0100.05014.81
5.3.130.0070.07314.67
5.3.120.0100.05314.60
5.3.110.0130.07314.49
5.3.100.0030.05314.25
5.3.90.0100.04714.13
5.3.80.0170.06014.13
5.3.70.0100.05014.13
5.3.60.0100.06313.86
5.3.50.0030.07313.82
5.3.40.0170.06014.00
5.3.30.0130.04014.03
5.3.20.0170.04013.80
5.3.10.0100.06713.87
5.3.00.0030.07713.76
5.2.170.0070.03711.29
5.2.160.0030.04311.15
5.2.150.0030.04311.16
5.2.140.0000.04711.29
5.2.130.0030.04011.05
5.2.120.0130.04710.93
5.2.110.0070.05311.09
5.2.100.0070.03711.00
5.2.90.0130.03711.13
5.2.80.0030.06311.11
5.2.70.0070.06311.11
5.2.60.0070.04710.89
5.2.50.0000.06711.17
5.2.40.0070.04011.00
5.2.30.0030.05010.89
5.2.20.0100.05011.12
5.2.10.0230.03010.95
5.2.00.0130.05310.72
5.1.60.0000.03710.14
5.1.50.0070.0339.92
5.1.40.0170.02310.05
5.1.30.0030.05010.42
5.1.20.0100.03010.29
5.1.10.0000.03710.16
5.1.00.0000.04010.11
5.0.50.0030.0278.40
5.0.40.0000.0438.44
5.0.30.0100.0338.18
5.0.20.0000.0308.25
5.0.10.0030.0278.14
5.0.00.0000.0608.07
4.4.90.0030.0277.39
4.4.80.0030.0207.39
4.4.70.0030.0207.39
4.4.60.0100.0277.39
4.4.50.0000.0377.39
4.4.40.0030.0337.39
4.4.30.0000.0237.39
4.4.20.0000.0237.39
4.4.10.0000.0237.39
4.4.00.0030.0307.39
4.3.110.0000.0237.39
4.3.100.0000.0307.39
4.3.90.0000.0237.39
4.3.80.0000.0337.39
4.3.70.0000.0237.39
4.3.60.0070.0237.39
4.3.50.0070.0277.39
4.3.40.0030.0307.39
4.3.30.0030.0207.39
4.3.20.0000.0277.39
4.3.10.0030.0207.39
4.3.00.0070.02013.33

preferences:
62.75 ms | 400 KiB | 5 Q