3v4l.org

run code in 300+ PHP versions simultaneously
<?php class purchase extends CI_Controller{ public function index() { $this->load->model('purchase_model'); $data['party']=$this->purchase_model->get_party(); $data['refno1']=$this->purchase_model->getref(); $data['items']=$this->purchase_model->get_items(); $this->load->view('purchase',$data); } public function getitems() { $this->load->model('purchase_model'); $this->purchase_model->getitems(); } public function getuser($id) { $this->load->model('purchase_model'); $this->purchase_model->get_user($id); } public function saveitem() { $refno= $this->input->post('refno'); $party = $this->input->post('party'); $item = $this->input->post('itemname'); $quantity = $this->input->post('quantity'); $price = $this->input->post('price'); // $amount = $this->input->post('amount'); $amount= $quantity*$price; $narration = $this->input->post('narration'); $this->load->model('purchase_model'); $partyid=$this->purchase_model->getpartyid($party); $this->load->model('purchase_model'); // $am= $this->purchase_model->getamount($refno); $result1= $this->purchase_model->checkduplicate($refno,$item); if($result1==0) { $result= $this->purchase_model->saveitem($refno,$item,$partyid,$quantity,$price,$amount,$narration); if ($result){ echo json_encode(array('success'=>true, 'msg'=>'inserted successfully', 'am'=>$amount )); } else { echo json_encode(array('msg'=>'Some errors occured.')); } } else { echo json_encode(array('success'=>true, 'msg'=>'item already exist', 'am'=>$amount )); } } public function updateitem($id) { $refno= $this->input->post('refno'); $party = $this->input->post('party'); $item = $this->input->post('itemname'); $quantity = $this->input->post('quantity'); $price = $this->input->post('price'); // $amount = $this->input->post('amount'); $amount= $quantity*$price; $narration = $this->input->post('narration'); $this->load->model('purchase_model'); $partyid=$this->purchase_model->getpartyid($party); $itemid=$this->purchase_model->getitemid('Waste Oil'); //$am= $this->purchase_model->getamount($refno); $result1= $this->purchase_model->updatecheckduplicate($id,$refno,$item); //echo json_encode(array('msg'=>$result1)); if($result1==0) { $result= $this->purchase_model->updateitem($id,$refno,$item,$partyid,$quantity,$price,$amount,$narration); if ($result){ echo json_encode(array('success'=>true, 'msg'=>'inserted successfully' )); } else { echo json_encode(array('msg'=>'Some errors occured.')); } } else { echo json_encode(array('success'=>true, 'msg'=>'inserted successfully' )); } } public function deleteitem() { $id= $this->input->post('id'); $this->load->model('purchase_model'); $result=$this->purchase_model->deleteitem($id); if ($result){ echo json_encode(array('success'=>true, 'msg'=>'inserted successfully' )); } else { echo json_encode(array('msg'=>'Some errors occured.')); } } public function submitreference() { $id= $this->input->post('refno1'); $recno= $this->input->post('recptno'); $date= $this->input->post('date'); $this->load->model('purchase_model'); // $total= $this->purchase_model->checkatleastoneitem($id); $duplicate= $this->purchase_model->checkduplicateref($id); if($duplicate!=0) { $this->load->model('purchase_model'); $data['party']=$this->purchase_model->get_party(); $data['refno1']=$this->purchase_model->getref(); $data['items']=$this->purchase_model->get_items(); $data['refexist']= $duplicate; $this->load->view('purchase',$data); } else if($total==0) { $this->load->model('purchase_model'); $data['party']=$this->purchase_model->get_party(); $data['refno1']=$this->purchase_model->getref(); $data['items']=$this->purchase_model->get_items(); $data['submitted']=1; $this->load->view('purchase',$data); } else { $this->load->model('purchase_model'); $this->purchase_model->submitreference($id,$date,$recno); $this->purchase_model->purchasestockmain($id); $data['party']=$this->purchase_model->get_party(); $data['refno1']=$this->purchase_model->getref(); $data['items']=$this->purchase_model->get_items(); $data['submitted']=2; $this->load->view('purchase',$data); } } } ?>

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.0100.00716.88
8.3.50.0090.00721.99
8.3.40.0190.00018.87
8.3.30.0150.00019.36
8.3.20.0070.00720.30
8.3.10.0000.00823.70
8.3.00.0050.00319.38
8.2.180.0120.00318.20
8.2.170.0160.00022.96
8.2.160.0140.00020.47
8.2.150.0090.00624.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0150.00322.25
8.2.110.0060.00322.13
8.2.100.0120.00018.03
8.2.90.0000.00819.38
8.2.80.0000.00918.05
8.2.70.0000.00817.63
8.2.60.0000.00817.77
8.2.50.0050.00318.07
8.2.40.0030.00519.76
8.2.30.0050.00218.17
8.2.20.0050.00317.91
8.2.10.0000.00918.21
8.2.00.0030.00717.90
8.1.280.0150.00625.92
8.1.270.0060.00323.72
8.1.260.0120.00626.35
8.1.250.0050.00328.09
8.1.240.0030.00623.85
8.1.230.0040.00823.89
8.1.220.0050.00317.76
8.1.210.0040.00418.77
8.1.200.0070.00317.35
8.1.190.0000.00817.63
8.1.180.0030.00718.10
8.1.170.0050.00518.71
8.1.160.0050.00322.10
8.1.150.0040.00418.61
8.1.140.0040.00417.43
8.1.130.0060.00317.86
8.1.120.0040.00417.40
8.1.110.0050.00517.39
8.1.100.0040.00417.45
8.1.90.0040.00417.51
8.1.80.0040.00417.33
8.1.70.0040.00417.42
8.1.60.0000.00817.63
8.1.50.0040.00417.54
8.1.40.0040.00417.57
8.1.30.0040.00417.58
8.1.20.0040.00417.59
8.1.10.0070.00017.61
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0000.00817.43
8.0.280.0000.00718.50
8.0.270.0050.00217.27
8.0.260.0000.00617.31
8.0.250.0040.00417.04
8.0.240.0090.00017.10
8.0.230.0000.00717.01
8.0.220.0000.00817.02
8.0.210.0000.00717.09
8.0.200.0030.00317.13
8.0.190.0030.00517.04
8.0.180.0070.00416.99
8.0.170.0040.00417.00
8.0.160.0040.00417.07
8.0.150.0000.00717.04
8.0.140.0040.00416.91
8.0.130.0030.00313.54
8.0.120.0040.00416.98
8.0.110.0030.00517.02
8.0.100.0000.00816.86
8.0.90.0040.00416.97
8.0.80.0100.00617.00
8.0.70.0030.00516.84
8.0.60.0000.00817.09
8.0.50.0040.00417.08
8.0.30.0090.01317.19
8.0.20.0110.00817.46
8.0.10.0000.00717.01
8.0.00.0100.01016.94
7.4.330.0020.00215.00
7.4.320.0030.00316.67
7.4.300.0070.00016.54
7.4.290.0040.00416.58
7.4.280.0000.00716.62
7.4.270.0040.00416.56
7.4.260.0000.00716.59
7.4.250.0000.00716.49
7.4.240.0010.00716.59
7.4.230.0000.00716.74
7.4.220.0130.00616.60
7.4.210.0080.00816.53
7.4.200.0000.00716.66
7.4.190.0030.00316.35
7.4.160.0080.00816.68
7.4.150.0050.01417.40
7.4.140.0110.00617.86
7.4.130.0130.00716.60
7.4.120.0080.01016.56
7.4.110.0070.01116.60
7.4.100.0090.01516.68
7.4.90.0070.01116.65
7.4.80.0120.00619.39
7.4.70.0140.00816.68
7.4.60.0150.00316.52
7.4.50.0000.00616.52
7.4.40.0100.00322.77
7.4.30.0070.01016.56
7.4.10.0100.00814.74
7.4.00.0050.01214.96
7.3.330.0070.00013.35
7.3.320.0030.00313.26
7.3.310.0000.00716.37
7.3.300.0030.00316.34
7.3.290.0090.00616.47
7.3.280.0110.01116.38
7.3.270.0160.00017.40
7.3.260.0160.02016.50
7.3.250.0050.01216.62
7.3.240.0080.00816.39
7.3.230.0060.01116.41
7.3.210.0140.00416.59
7.3.200.0070.01419.39
7.3.190.0030.01516.58
7.3.180.0120.00916.41
7.3.170.0160.00716.43
7.3.160.0030.01416.54
7.3.130.0020.01614.86
7.3.120.0040.01115.03
7.3.110.0090.01014.95
7.3.100.0030.01115.09
7.3.90.0080.00814.79
7.3.80.0040.00614.87
7.3.70.0040.01114.87
7.3.60.0070.00614.91
7.3.50.0070.00715.03
7.3.40.0020.01214.82
7.3.30.0040.00914.78
7.3.20.0030.00716.77
7.3.10.0080.00816.60
7.3.00.0080.00816.66
7.2.330.0120.00616.68
7.2.320.0090.01116.71
7.2.310.0100.00716.41
7.2.300.0170.00016.50
7.2.290.0030.01416.74
7.2.260.0100.00614.93
7.2.250.0090.00914.91
7.2.240.0080.00815.01
7.2.230.0040.01114.86
7.2.220.0080.00814.90
7.2.210.0050.00815.06
7.2.200.0100.00614.96
7.2.190.0060.00814.95
7.2.180.0040.00815.03
7.2.170.0080.00714.88
7.2.160.0040.01114.95
7.2.150.0070.00616.79
7.2.140.0060.01116.84
7.2.130.0090.00416.76
7.2.120.0050.00716.77
7.2.110.0060.00816.71
7.2.100.0080.00616.76
7.2.90.0050.00816.81
7.2.80.0080.00616.73
7.2.70.0080.00816.78
7.2.60.0070.00916.80
7.2.50.0050.00716.77
7.2.40.0040.01216.76
7.2.30.0080.00716.68
7.2.20.0050.01016.97
7.2.10.0020.01216.91
7.2.00.0030.01017.56
7.1.330.0050.00815.73
7.1.320.0050.01115.59
7.1.310.0020.01315.68
7.1.300.0050.00915.59
7.1.290.0020.01115.56
7.1.280.0060.00715.36
7.1.270.0080.00515.44
7.1.260.0110.00315.48
7.1.250.0030.00915.49
7.1.240.0050.00815.59
7.1.230.0080.00615.57
7.1.220.0070.00915.72
7.1.210.0050.00915.79
7.1.200.0030.01215.48
7.1.190.0030.01315.45
7.1.180.0090.00615.49
7.1.170.0040.00915.66
7.1.160.0020.01515.47
7.1.150.0010.01115.42
7.1.140.0050.01015.49
7.1.130.0040.00615.59
7.1.120.0070.00815.60
7.1.110.0120.00315.61
7.1.100.0030.00916.41
7.1.90.0060.00615.69
7.1.80.0030.00915.55
7.1.70.0070.00515.94
7.1.60.0100.00516.99
7.1.50.0030.01415.92
7.1.40.0070.00515.47
7.1.30.0060.00815.65
7.1.20.0100.00715.66
7.1.10.0050.00615.38
7.1.00.0040.03317.89
7.0.330.0030.01015.39
7.0.320.0060.00915.28
7.0.310.0080.00715.07
7.0.300.0060.01015.18
7.0.290.0080.00715.03
7.0.280.0060.00715.14
7.0.270.0070.00515.11
7.0.260.0050.00815.16
7.0.250.0020.01115.14
7.0.240.0040.00515.22
7.0.230.0030.00915.25
7.0.220.0030.00815.28
7.0.210.0070.00515.31
7.0.200.0220.00915.09
7.0.190.0070.00315.49
7.0.180.0050.01215.13
7.0.170.0050.00915.09
7.0.160.0060.00815.28
7.0.150.0020.00615.36
7.0.140.0080.02717.65
7.0.130.0040.01215.43
7.0.120.0090.00515.29
7.0.110.0070.00515.23
7.0.100.0020.00915.20
7.0.90.0270.01916.76
7.0.80.0170.01916.89
7.0.70.0240.01916.79
7.0.60.0230.02116.90
7.0.50.0190.01716.93
7.0.40.0060.02315.47
7.0.30.0050.02515.68
7.0.20.0070.03115.63
7.0.10.0090.02815.61
7.0.00.0110.02815.59
5.6.400.0030.01314.40
5.6.390.0060.00814.33
5.6.380.0050.01114.62
5.6.370.0060.01014.23
5.6.360.0090.00614.16
5.6.350.0050.00814.44
5.6.340.0040.00614.19
5.6.330.0080.00514.49
5.6.320.0070.00914.36
5.6.310.0100.00314.53
5.6.300.0030.00914.16
5.6.290.0030.00914.13
5.6.280.0020.03016.59
5.6.270.0100.00214.47
5.6.260.0060.01014.06
5.6.250.0080.00514.13
5.6.240.0020.02616.34
5.6.230.0060.02716.26
5.6.220.0060.02216.47
5.6.210.0100.02816.42
5.6.200.0070.02116.41
5.6.190.0050.03316.51
5.6.180.0030.02416.42
5.6.170.0050.03516.59
5.6.160.0030.02616.52
5.6.150.0040.03416.58
5.6.140.0070.02816.54
5.6.130.0060.03616.75
5.6.120.0030.03516.50
5.6.110.0090.03016.49
5.6.100.0030.02716.54
5.6.90.0060.03216.58
5.6.80.0080.02816.32
5.6.70.0010.02416.26
5.6.60.0100.02516.17
5.6.50.0080.03016.19
5.6.40.0060.02916.30
5.6.30.0010.03216.13
5.6.20.0070.03016.28
5.6.10.0080.01716.29
5.6.00.0040.02016.35
5.5.380.0070.02416.29
5.5.370.0050.03116.40
5.5.360.0050.02116.35
5.5.350.0080.02616.17
5.5.340.0100.01916.51
5.5.330.0110.02516.38
5.5.320.0070.03116.53
5.5.310.0050.02116.42
5.5.300.0120.02716.26
5.5.290.0020.03716.53
5.5.280.0070.01916.50
5.5.270.0070.03116.39
5.5.260.0020.03716.34
5.5.250.0080.03116.37
5.5.240.0040.03116.01
5.5.230.0070.02716.14
5.5.220.0060.02915.98
5.5.210.0040.03516.04
5.5.200.0010.02416.20
5.5.190.0060.02216.04
5.5.180.0050.02216.04
5.5.170.0040.01114.16
5.5.160.0050.02716.19
5.5.150.0060.02416.18
5.5.140.0020.03516.13
5.5.130.0100.03016.16
5.5.120.0090.02015.97
5.5.110.0080.02816.16
5.5.100.0070.03016.17
5.5.90.0090.02116.05
5.5.80.0090.02516.13
5.5.70.0090.03216.05
5.5.60.0030.03216.02
5.5.50.0090.02816.05
5.5.40.0030.02015.99
5.5.30.0070.02416.13
5.5.20.0070.02915.95
5.5.10.0070.03216.01
5.5.00.0060.02716.07
5.4.450.0070.01613.67
5.4.440.0050.02113.83
5.4.430.0050.03013.78
5.4.420.0060.02613.73
5.4.410.0080.02713.70
5.4.400.0020.03113.62
5.4.390.0070.01913.63
5.4.380.0060.02413.67
5.4.370.0060.02813.68
5.4.360.0070.02713.65
5.4.350.0060.02713.60
5.4.340.0050.02813.60
5.4.330.0040.00910.96
5.4.320.0040.01713.60
5.4.310.0110.02413.58
5.4.300.0060.02013.64
5.4.290.0070.02213.64
5.4.280.0090.02913.67
5.4.270.0050.02613.69
5.4.260.0040.02913.69
5.4.250.0070.02813.67
5.4.240.0050.02013.60
5.4.230.0020.03313.71
5.4.220.0110.02513.68
5.4.210.0090.02713.61
5.4.200.0090.02613.63
5.4.190.0070.02713.61
5.4.180.0050.02813.55
5.4.170.0080.01913.59
5.4.160.0070.03113.65
5.4.150.0060.02913.67
5.4.140.0050.02812.73
5.4.130.0020.02812.70
5.4.120.0020.02512.73
5.4.110.0050.01812.75
5.4.100.0050.02912.71
5.4.90.0020.02512.78
5.4.80.0040.02012.75
5.4.70.0050.02512.77
5.4.60.0080.02412.79
5.4.50.0090.02412.71
5.4.40.0070.01712.73
5.4.30.0120.02212.70
5.4.20.0070.02612.74
5.4.10.0040.02312.80
5.4.00.0060.02612.58
5.3.290.0010.02012.16
5.3.280.0040.02912.11
5.3.270.0040.03212.12
5.3.260.0080.02612.18
5.3.250.0040.02812.12
5.3.240.0060.02712.15
5.3.230.0060.02712.15
5.3.220.0030.01912.12
5.3.210.0030.02212.15
5.3.200.0060.02912.12
5.3.190.0010.03312.13
5.3.180.0050.01912.14
5.3.170.0050.03012.11
5.3.160.0050.01712.14
5.3.150.0050.02712.11
5.3.140.0080.02512.09
5.3.130.0020.03412.13
5.3.120.0030.02412.12
5.3.110.0030.03212.14
5.3.100.0020.02811.93
5.3.90.0050.03011.96
5.3.80.0050.01911.93
5.3.70.0030.03211.95
5.3.60.0050.02811.93
5.3.50.0050.03011.92
5.3.40.0050.02811.89
5.3.30.0100.02311.91
5.3.20.0090.02311.84
5.3.10.0050.02611.86
5.3.00.0020.03011.82

preferences:
47.27 ms | 401 KiB | 5 Q