3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_upload() { $upload_conf = array( 'upload_path' => realpath('assets/doc/img/real/'), 'allowed_types' => 'gif|jpg|png|JPEG|JPG', 'max_size' => '30000', 'encrypt_name' => TRUE, 'remove_spaces' => TRUE, 'overwrite' => TRUE ); $this->load->library('upload', $upload_conf); foreach ($_FILES['userfile'] as $key => $val) { $i = 1; foreach ($val as $v) { $field_name = "file_" . $i; $_FILES[$field_name][$key] = $v; $i++; } } unset($_FILES['userfile']); foreach ($_FILES as $field_name => $file) { if (!$this->upload->do_upload($field_name)) { echo $this->image_lib->display_errors(); } else { $upload_data = $this->upload->data(); // Watermark $ori = $upload_data['file_name']; $mr = $upload_data['file_path'] . $ori; $this->watermarking($mr); /* //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/full/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 0; $config['height'] = 0; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/medium/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 342; $config['height'] = 342; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //small image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/small/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 152; $config['height'] = 152; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //cropped thumbnail $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/thumbnails/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 62; $config['height'] = 62; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); */ // do it! if (!$this->image_lib->resize()) { // if got fail. //$error['resize'][] = $this->image_lib->display_errors(); echo $this->image_lib->display_errors(); } else { // otherwise, put each upload data to an array. $success[] = $upload_data; } } } // see what we get if (count($error > 0)) { $data['error'] = $error; } else { $data['success'] = $upload_data; } $data['multiupload'] = "multiupload"; // Controller $data['view'] = "index_multiupload"; // View $data['module'] = "multiupload"; // Controller $data['error'] = ' '; dump($this->upload->data()); echo Modules::run('template/staff', $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.0110.00718.32
8.3.50.0080.01121.99
8.3.40.0060.00918.48
8.3.30.0110.00318.96
8.3.20.0070.00020.38
8.3.10.0040.00422.09
8.3.00.0090.00022.25
8.2.180.0030.01416.50
8.2.170.0060.01222.96
8.2.160.0090.00920.68
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0070.00326.16
8.2.120.0040.00417.50
8.2.110.0060.00322.10
8.2.100.0000.01117.66
8.2.90.0050.00219.09
8.2.80.0040.00417.97
8.2.70.0070.00317.50
8.2.60.0080.00017.80
8.2.50.0030.00518.07
8.2.40.0040.00418.03
8.2.30.0050.00317.98
8.2.20.0040.00417.62
8.2.10.0040.00419.22
8.2.00.0000.01017.58
8.1.280.0200.00725.92
8.1.270.0000.00822.14
8.1.260.0060.00026.35
8.1.250.0000.00828.09
8.1.240.0090.00023.91
8.1.230.0040.00819.14
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.13
8.1.190.0050.00317.39
8.1.180.0030.00518.10
8.1.170.0000.00818.65
8.1.160.0000.00822.02
8.1.150.0040.00418.57
8.1.140.0070.00317.42
8.1.130.0030.00317.83
8.1.120.0070.00017.34
8.1.110.0040.00417.24
8.1.100.0070.00017.41
8.1.90.0070.00017.37
8.1.80.0000.00717.30
8.1.70.0030.00317.30
8.1.60.0040.00417.37
8.1.50.0030.00617.44
8.1.40.0000.00817.36
8.1.30.0080.00017.37
8.1.20.0040.00417.55
8.1.10.0080.00017.41
8.1.00.0000.00817.34
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0050.00318.34
8.0.270.0000.00817.18
8.0.260.0050.00216.79
8.0.250.0000.00716.86
8.0.240.0030.00316.84
8.0.230.0070.00016.75
8.0.220.0030.00616.70
8.0.210.0000.00716.74
8.0.200.0000.00716.92
8.0.190.0000.00716.73
8.0.180.0100.00016.85
8.0.170.0080.00016.80
8.0.160.0000.00916.81
8.0.150.0030.00316.63
8.0.140.0050.00516.64
8.0.130.0050.00013.29
8.0.120.0000.00816.65
8.0.110.0000.00816.66
8.0.100.0000.00716.66
8.0.90.0000.00716.69
8.0.80.0000.01516.77
8.0.70.0050.00316.82
8.0.60.0040.00416.76
8.0.50.0030.00616.59
8.0.30.0090.00916.83
8.0.20.0120.00717.40
8.0.10.0040.00416.92
8.0.00.0100.00616.48
7.4.330.0000.00515.07
7.4.320.0060.00016.34
7.4.300.0030.00316.50
7.4.290.0000.01016.35
7.4.280.0070.00016.48
7.4.270.0000.00716.52
7.4.260.0030.00316.53
7.4.250.0000.00716.48
7.4.240.0030.00316.53
7.4.230.0040.00416.35
7.4.220.0060.01216.59
7.4.210.0050.01016.43
7.4.200.0070.00016.32
7.4.190.0000.00716.50
7.4.160.0210.00016.27
7.4.150.0150.00617.40
7.4.140.0130.00517.86
7.4.130.0060.01316.49
7.4.120.0060.01316.42
7.4.110.0150.00716.43
7.4.100.0090.01116.42
7.4.90.0130.00316.25
7.4.80.0130.00619.39
7.4.70.0050.01116.42
7.4.60.0070.01016.40
7.4.50.0060.00016.15
7.4.40.0110.00722.77
7.4.30.0040.01216.43
7.4.00.0090.00914.98
7.3.330.0000.00512.97
7.3.320.0030.00313.08
7.3.310.0000.00716.09
7.3.300.0040.00416.16
7.3.290.0160.00316.21
7.3.280.0100.00816.20
7.3.270.0130.00417.40
7.3.260.0100.00916.43
7.3.250.0110.00916.31
7.3.240.0110.00616.46
7.3.230.0180.00316.39
7.3.210.0100.00716.38
7.3.200.0080.00819.39
7.3.190.0140.00316.51
7.3.180.0060.01316.39
7.3.170.0070.01116.48
7.3.160.0090.00616.37
7.3.120.0060.01214.76
7.3.110.0020.01714.80
7.3.100.0070.01414.66
7.3.90.0040.01114.86
7.3.80.0030.01614.64
7.3.70.0030.00914.59
7.3.60.0030.01014.72
7.3.50.0030.01014.75
7.3.40.0080.00414.79
7.3.30.0100.00314.73
7.3.20.0100.00316.46
7.3.10.0000.01016.39
7.3.00.0070.00716.33
7.2.330.0030.01616.25
7.2.320.0120.00916.57
7.2.310.0140.00416.53
7.2.300.0060.01116.20
7.2.290.0030.01316.57
7.2.250.0130.00314.79
7.2.240.0100.01014.93
7.2.230.0090.00914.92
7.2.220.0000.01314.81
7.2.210.0030.01314.77
7.2.200.0080.00314.80
7.2.190.0030.01414.98
7.2.180.0070.00714.73
7.2.170.0060.00914.93
7.2.160.0070.00714.79
7.2.150.0030.00616.89
7.2.140.0060.00916.44
7.2.130.0030.00716.59
7.2.120.0040.01116.85
7.2.110.0000.01416.42
7.2.100.0100.00616.73
7.2.90.0100.00716.76
7.2.80.0070.00716.84
7.2.70.0040.01216.76
7.2.60.0130.00316.53
7.2.50.0030.01016.45
7.2.40.0030.01216.49
7.2.30.0070.00716.41
7.2.20.0110.00416.71
7.2.10.0030.00916.59
7.2.00.0050.00917.82
7.1.330.0090.00915.70
7.1.320.0090.00015.68
7.1.310.0100.00715.74
7.1.300.0060.00315.61
7.1.290.0060.00315.65
7.1.280.0060.00315.66
7.1.270.0000.01115.64
7.1.260.0040.00815.79
7.1.250.0030.01015.66
7.1.240.0000.00915.46
7.1.230.0070.00715.51
7.1.220.0030.01315.44
7.1.210.0030.00915.52
7.1.200.0080.00315.46
7.1.190.0070.00715.67
7.1.180.0120.00615.38
7.1.170.0120.00315.55
7.1.160.0030.00915.50
7.1.150.0040.00415.74
7.1.140.0100.00315.51
7.1.130.0030.01015.55
7.1.120.0040.00815.52
7.1.110.0070.01015.69
7.1.100.0050.00616.82
7.1.90.0030.01015.51
7.1.80.0060.00915.31
7.1.70.0060.00916.09
7.1.60.0050.01017.62
7.1.50.0070.01116.18
7.1.40.0000.01015.66
7.1.30.0030.00915.60
7.1.20.0000.01615.68
7.1.10.0060.00815.65
7.1.00.0030.04519.07
7.0.330.0060.00615.25
7.0.320.0100.00615.29
7.0.310.0080.00614.96
7.0.300.0030.01415.03
7.0.290.0040.00815.11
7.0.280.0070.01015.23
7.0.270.0000.01215.15
7.0.260.0000.01315.46
7.0.250.0090.00615.23
7.0.240.0040.00815.33
7.0.230.0090.00615.14
7.0.220.0150.00315.34
7.0.210.0000.01615.11
7.0.200.0030.01015.84
7.0.190.0070.00715.32
7.0.180.0070.01015.37
7.0.170.0090.00615.23
7.0.160.0060.00615.42
7.0.150.0030.01015.04
7.0.140.0090.03518.62
7.0.130.0000.01215.31
7.0.120.0070.00415.49
7.0.110.0030.00915.13
7.0.100.0050.04017.58
7.0.90.0100.04217.61
7.0.80.0190.03817.65
7.0.70.0050.03617.50
7.0.60.0030.03317.67
7.0.50.0050.03017.84
7.0.40.0050.04016.87
7.0.30.0080.03216.86
7.0.20.0080.02816.77
7.0.10.0090.02516.88
7.0.00.0070.03716.88
5.6.400.0000.00913.98
5.6.390.0050.00514.28
5.6.380.0060.00614.10
5.6.370.0000.01114.16
5.6.360.0120.00314.34
5.6.350.0000.01314.39
5.6.340.0040.00714.39
5.6.330.0030.00914.46
5.6.320.0030.01014.04
5.6.310.0110.00713.81
5.6.300.0090.00614.05
5.6.290.0080.00814.21
5.6.280.0000.04417.56
5.6.270.0040.01114.04
5.6.260.0030.00914.28
5.6.250.0050.04017.55
5.6.240.0120.03717.59
5.6.230.0000.04817.41
5.6.220.0060.03417.36
5.6.210.0050.03117.44
5.6.200.0070.04217.63
5.6.190.0050.03517.61
5.6.180.0070.04517.53
5.6.170.0050.02417.65
5.6.160.0130.03317.71
5.6.150.0070.04317.68
5.6.140.0070.04217.47
5.6.130.0030.05017.44
5.6.120.0070.04717.61
5.6.110.0030.04817.57
5.6.100.0030.03117.66
5.6.90.0030.02817.58
5.6.80.0030.03517.07
5.6.70.0090.02017.24
5.6.60.0020.02917.34
5.6.50.0020.02517.25
5.6.40.0030.03017.38
5.6.30.0080.02217.22
5.6.20.0080.02317.26
5.6.10.0050.02517.21
5.6.00.0030.02517.10
5.5.380.0080.04417.34
5.5.370.0110.03917.36
5.5.360.0140.03617.23
5.5.350.0030.03217.32
5.5.340.0080.03517.27
5.5.330.0090.03917.51
5.5.320.0030.04517.46
5.5.310.0070.04017.40
5.5.300.0070.03817.39
5.5.290.0020.03117.33
5.5.280.0060.02117.41
5.5.270.0050.04017.46
5.5.260.0040.04717.41
5.5.250.0080.03817.49
5.5.240.0030.02517.23
5.5.230.0050.02317.20
5.5.220.0030.02617.14
5.5.210.0030.02217.04
5.5.200.0040.02517.22
5.5.190.0070.02317.09
5.5.180.0070.02316.96
5.5.170.0030.01414.07
5.5.160.0050.02316.93
5.5.150.0030.02517.21
5.5.140.0030.02517.06
5.5.130.0020.03017.01
5.5.120.0070.02216.99
5.5.110.0030.02517.14
5.5.100.0030.02517.10
5.5.90.0050.02317.00
5.5.80.0110.01517.17
5.5.70.0050.02317.14
5.5.60.0030.02416.89
5.5.50.0070.02017.06
5.5.40.0020.02817.09
5.5.30.0030.02617.04
5.5.20.0030.02416.96
5.5.10.0050.02616.88
5.5.00.0050.02817.01
5.4.450.0080.04016.47
5.4.440.0050.02316.52
5.4.430.0020.04816.48
5.4.420.0020.03016.43
5.4.410.0040.02516.49
5.4.400.0070.02516.37
5.4.390.0060.02316.33
5.4.380.0060.02016.38
5.4.370.0030.02316.32
5.4.360.0080.02016.36
5.4.350.0070.02116.24
5.4.340.0070.01916.36
5.4.330.0060.00013.59
5.4.320.0030.02216.32
5.4.310.0030.02316.24
5.4.300.0000.02816.31
5.4.290.0020.02316.35
5.4.280.0100.01716.22
5.4.270.0020.02516.33
5.4.260.0050.02316.36
5.4.250.0060.01916.36
5.4.240.0050.02216.33
5.4.230.0020.02516.33
5.4.220.0030.02216.36
5.4.210.0020.02216.34
5.4.200.0050.01816.36
5.4.190.0060.02216.36
5.4.180.0020.02516.37
5.4.170.0060.02016.35
5.4.160.0030.02216.21
5.4.150.0020.02516.21
5.4.140.0040.02014.98
5.4.130.0110.01515.00
5.4.120.0020.02414.87
5.4.110.0030.02015.03
5.4.100.0070.01814.97
5.4.90.0070.01514.99
5.4.80.0000.03215.02
5.4.70.0050.03615.04
5.4.60.0060.02314.96
5.4.50.0110.01614.96
5.4.40.0040.03514.96
5.4.30.0100.03014.94
5.4.20.0070.03515.03
5.4.10.0030.04215.02
5.4.00.0050.03614.70
5.3.290.0040.02014.12
5.3.280.0050.02014.10
5.3.270.0020.02414.13
5.3.260.0020.02214.07
5.3.250.0030.02114.12
5.3.240.0020.02514.11
5.3.230.0040.02114.13
5.3.220.0030.02314.09
5.3.210.0000.02414.15
5.3.200.0070.02014.13
5.3.190.0050.02014.14
5.3.180.0060.01614.08
5.3.170.0050.02014.14
5.3.160.0030.03614.14
5.3.150.0060.02014.09
5.3.140.0080.02514.04
5.3.130.0030.04314.11
5.3.120.0110.03614.14
5.3.110.0030.04314.14
5.3.100.0000.02113.87
5.3.90.0030.04013.88
5.3.80.0050.03013.88
5.3.70.0030.04113.84
5.3.60.0030.04313.82
5.3.50.0080.03813.84
5.3.40.0030.04713.80
5.3.30.0070.02813.75
5.3.20.0030.02613.69
5.3.10.0050.03213.60
5.3.00.0020.03713.69
5.2.170.0130.04311.30
5.2.160.0000.06311.23
5.2.150.0030.05711.03
5.2.140.0070.05011.08
5.2.130.0070.02711.25
5.2.120.0030.05711.25
5.2.110.0030.05711.26
5.2.100.0070.05711.01
5.2.90.0030.06010.98
5.2.80.0030.06011.10
5.2.70.0070.05311.15
5.2.60.0000.06710.95
5.2.50.0100.04310.97
5.2.40.0030.06311.07
5.2.30.0000.06011.06
5.2.20.0070.06011.03
5.2.10.0030.03710.94
5.2.00.0030.04710.86
5.1.60.0030.05710.08
5.1.50.0070.0279.86
5.1.40.0030.05310.07
5.1.30.0170.04710.32
5.1.20.0030.06010.27
5.1.10.0070.04710.09
5.1.00.0000.0279.93
5.0.50.0070.0308.66
5.0.40.0030.0438.47
5.0.30.0030.0678.13
5.0.20.0100.0308.29
5.0.10.0070.0378.19
5.0.00.0070.0508.24
4.4.90.0000.0377.97
4.4.80.0000.0307.97
4.4.70.0000.0177.97
4.4.60.0070.0177.97
4.4.50.0000.0277.97
4.4.40.0000.0477.97
4.4.30.0000.0377.97
4.4.20.0070.0277.97
4.4.10.0030.0337.97
4.4.00.0030.0507.97
4.3.110.0070.0277.97
4.3.100.0030.0137.97
4.3.90.0000.0377.97
4.3.80.0000.0477.97
4.3.70.0030.0307.97
4.3.60.0070.0307.97
4.3.50.0000.0377.97
4.3.40.0000.0537.97
4.3.30.0000.0177.97
4.3.20.0000.0177.97
4.3.10.0000.0177.97
4.3.00.0000.0337.97

preferences:
46.8 ms | 401 KiB | 5 Q