3v4l.org

run code in 300+ PHP versions simultaneously
<?php class pumps extends CI_Controller{ function __construct(){ parent::__construct(); $this->load->model('pump'); } function index(){ // $this->load->view('common/header'); $this->load->view('pumps/index3'); } function singlepump($pump_id = null){ if( !$this->pump->ownsReservation($pump_id) || is_null($pump_id) || $pump_id > 8 || $pump_id < 0) { redirect(''); } log_message('info','Request: Clearing reservations and resetting motors'); error_log('Request: Clearing reservations and resetting motors'); var $reservations = $this->pump->getReservations(); foreach ( $reservations as $resvd_id => $status ) { if ( $status === 'OPEN' ) continue; log_message('info','Request: Motor #' . $resvd_id . ' set to speed of 0'); error_log('Request: Motor #' . $resvd_id . ' set to speed of 0'); $command_string = '/webroot/fountain/server_side.py -m ' . $resvd_id . ' -s 0'; exec($command_string); } $this->pump->clearReservations(); $this->pump->createReservation($pump_id); $this->load->view('pumps/singlepump', array('pump_id' => $pump_id)); } function init(){ //Using the controller allows the connection to be made //by the server and not by the client. //This will also allow us to check for reservations //And create session data $ip_address = $this->input->get('ip_address'); $motor = $this->uri->segment('3'); $speed = $this->uri->segment('4'); $this->pump->createReservation($motor); log_message('info','Request: Motor #' . $motor . ' set to speed of ' . $speed); error_log('Request: Motor #' . $motor . ' set to speed of ' . $speed); $command_string = '/webroot/fountain/server_side.py -m ' . $motor . ' -s ' . $speed; exec($command_string); /* $url = 'http://10.0.0.126/minit/' . $motor . '/' . $speed; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 0, CURLOPT_URL => $url )); curl_exec($curl); curl_close($curl); * */ echo $this->pump->createReservation($motor); } function status(){ $state = $this->pump->getReservations(); # echo '<pre>'; echo json_encode($state,JSON_FORCE_OBJECT); # echo '</pre>'; } function telnet(){ exec('/webroot/fountain/server_side.py -m 0 -s 1000'); } }

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)
5.4.350.0090.05212.04
5.4.340.0110.04412.03
5.4.320.0130.04012.52
5.4.310.0090.04312.52
5.4.300.0090.04112.52
5.4.290.0070.04612.52
5.4.280.0060.05012.41
5.4.270.0220.06012.41
5.4.260.0110.05712.41
5.4.250.0070.07512.41
5.4.240.0160.05812.41
5.4.230.0070.07212.41
5.4.220.0130.11712.40
5.4.210.0090.04812.41
5.4.200.0070.04812.41
5.4.190.0130.08212.40
5.4.180.0090.04112.40
5.4.170.0080.04112.41
5.4.160.0050.04512.41
5.4.150.0090.04612.40
5.4.140.0110.09412.09
5.4.130.0050.04012.07
5.4.120.0210.07112.04
5.4.110.0110.08012.03
5.4.100.0110.04212.03
5.4.90.0180.08012.04
5.4.80.0060.04912.03
5.4.70.0100.06512.03
5.4.60.0140.05412.03
5.4.50.0070.04312.03
5.4.40.0090.04712.02
5.4.30.0130.05212.01
5.4.20.0090.04812.01
5.4.10.0100.08412.02
5.4.00.0140.08111.51
5.3.290.0080.05112.80
5.3.280.0100.04712.71
5.3.270.0040.07112.73
5.3.260.0210.07212.72
5.3.250.0130.06412.72
5.3.240.0150.11012.72
5.3.230.0150.06812.71
5.3.220.0320.09912.68
5.3.210.0250.10412.68
5.3.200.0090.04912.68
5.3.190.0100.04112.68
5.3.180.0140.04212.67
5.3.170.0070.04812.67
5.3.160.0130.06212.68
5.3.150.0120.05612.67
5.3.140.0120.04112.66
5.3.130.0110.04312.66
5.3.120.0070.04312.66
5.3.110.0050.04612.66
5.3.100.0070.04112.13
5.3.90.0090.03912.11
5.3.80.0040.04412.10
5.3.70.0070.04612.10
5.3.60.0150.08012.09
5.3.50.0170.06212.03
5.3.40.0110.05612.03
5.3.30.0070.04011.99
5.3.20.0100.04211.77
5.3.10.0100.04011.74
5.3.00.0070.04111.72
5.2.170.0150.0519.23
5.2.160.0060.0369.23
5.2.150.0130.1119.23
5.2.140.0100.0539.23
5.2.130.0180.1539.19
5.2.120.0060.0419.19
5.2.110.0140.0529.20
5.2.100.0090.0879.19
5.2.90.0100.0409.19
5.2.80.0120.0839.18
5.2.70.0080.0499.18
5.2.60.0070.0499.14
5.2.50.0130.0439.11
5.2.40.0080.0479.09
5.2.30.0080.0749.06
5.2.20.0230.0749.05
5.2.10.0100.0328.95
5.2.00.0090.0828.81
5.1.60.0060.0458.10
5.1.50.0070.0288.09
5.1.40.0070.0708.08
5.1.30.0120.0438.43
5.1.20.0140.0588.45
5.1.10.0150.0628.18
5.1.00.0110.0458.18
5.0.50.0040.0266.65
5.0.40.0140.0436.52
5.0.30.0060.0346.33
5.0.20.0100.0246.29
5.0.10.0100.0306.27
5.0.00.0060.0526.26
4.4.90.0030.0294.77
4.4.80.0190.0794.75
4.4.70.0040.0214.75
4.4.60.0050.0204.76
4.4.50.0040.0224.77
4.4.40.0050.0334.70
4.4.30.0040.0224.76
4.4.20.0040.0254.84
4.4.10.0040.0284.85
4.4.00.0050.0334.76
4.3.110.0050.0254.67
4.3.100.0040.0204.66
4.3.90.0040.0194.64
4.3.80.0050.0304.59
4.3.70.0020.0224.63
4.3.60.0070.0174.63
4.3.50.0040.0214.62
4.3.40.0050.0314.54
4.3.30.0040.0213.31
4.3.20.0050.0223.29
4.3.10.0050.0223.25
4.3.00.0030.0206.57

preferences:
143.48 ms | 1386 KiB | 7 Q