3v4l.org

run code in 500+ PHP versions simultaneously
<?php $options = [ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_RETURNTRANSFER => false, CURLOPT_HEADER => false, CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_UPLOAD => true, CURLOPT_URL => 'http://httpbin.org/put', CURLOPT_CONNECTTIMEOUT => 1, CURLOPT_HTTPHEADER => [ 'Content-Type: text/plain; charset=UTF-8', ], CURLOPT_READFUNCTION => function($handle, $fp, $length) { static $data = 'HelloWorld'; $readed = $data; $data = ''; echo "Length asked: '{$length}'\n"; echo "Readed: '{$readed}'\n"; return $readed; }, CURLOPT_INFILESIZE => strlen('HelloWorld') // The extra byte ]; $handle = curl_init(); curl_setopt_array($handle, $options); curl_exec($handle);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.31, 8.3.0 - 8.3.32, 8.4.1 - 8.4.23, 8.5.0 - 8.5.8
Fatal error: Uncaught Error: Undefined constant "CURLOPT_HTTP_VERSION" in /in/uAYEf:4 Stack trace: #0 {main} thrown in /in/uAYEf on line 4
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 4 Warning: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 4 Warning: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 5 Warning: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 6 Warning: Use of undefined constant CURLOPT_CUSTOMREQUEST - assumed 'CURLOPT_CUSTOMREQUEST' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 7 Warning: Use of undefined constant CURLOPT_UPLOAD - assumed 'CURLOPT_UPLOAD' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 8 Warning: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 9 Warning: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 10 Warning: Use of undefined constant CURLOPT_HTTPHEADER - assumed 'CURLOPT_HTTPHEADER' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 11 Warning: Use of undefined constant CURLOPT_READFUNCTION - assumed 'CURLOPT_READFUNCTION' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 14 Warning: Use of undefined constant CURLOPT_INFILESIZE - assumed 'CURLOPT_INFILESIZE' (this will throw an Error in a future version of PHP) in /in/uAYEf on line 22 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uAYEf:25 Stack trace: #0 {main} thrown in /in/uAYEf on line 25
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/uAYEf on line 4 Notice: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' in /in/uAYEf on line 4 Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /in/uAYEf on line 5 Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /in/uAYEf on line 6 Notice: Use of undefined constant CURLOPT_CUSTOMREQUEST - assumed 'CURLOPT_CUSTOMREQUEST' in /in/uAYEf on line 7 Notice: Use of undefined constant CURLOPT_UPLOAD - assumed 'CURLOPT_UPLOAD' in /in/uAYEf on line 8 Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/uAYEf on line 9 Notice: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /in/uAYEf on line 10 Notice: Use of undefined constant CURLOPT_HTTPHEADER - assumed 'CURLOPT_HTTPHEADER' in /in/uAYEf on line 11 Notice: Use of undefined constant CURLOPT_READFUNCTION - assumed 'CURLOPT_READFUNCTION' in /in/uAYEf on line 14 Notice: Use of undefined constant CURLOPT_INFILESIZE - assumed 'CURLOPT_INFILESIZE' in /in/uAYEf on line 22 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/uAYEf:25 Stack trace: #0 {main} thrown in /in/uAYEf on line 25
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Notice: Use of undefined constant CURLOPT_HTTP_VERSION - assumed 'CURLOPT_HTTP_VERSION' in /in/uAYEf on line 4 Notice: Use of undefined constant CURL_HTTP_VERSION_1_1 - assumed 'CURL_HTTP_VERSION_1_1' in /in/uAYEf on line 4 Notice: Use of undefined constant CURLOPT_RETURNTRANSFER - assumed 'CURLOPT_RETURNTRANSFER' in /in/uAYEf on line 5 Notice: Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' in /in/uAYEf on line 6 Notice: Use of undefined constant CURLOPT_CUSTOMREQUEST - assumed 'CURLOPT_CUSTOMREQUEST' in /in/uAYEf on line 7 Notice: Use of undefined constant CURLOPT_UPLOAD - assumed 'CURLOPT_UPLOAD' in /in/uAYEf on line 8 Notice: Use of undefined constant CURLOPT_URL - assumed 'CURLOPT_URL' in /in/uAYEf on line 9 Notice: Use of undefined constant CURLOPT_CONNECTTIMEOUT - assumed 'CURLOPT_CONNECTTIMEOUT' in /in/uAYEf on line 10 Notice: Use of undefined constant CURLOPT_HTTPHEADER - assumed 'CURLOPT_HTTPHEADER' in /in/uAYEf on line 11 Notice: Use of undefined constant CURLOPT_READFUNCTION - assumed 'CURLOPT_READFUNCTION' in /in/uAYEf on line 14 Notice: Use of undefined constant CURLOPT_INFILESIZE - assumed 'CURLOPT_INFILESIZE' in /in/uAYEf on line 22 Fatal error: Call to undefined function curl_init() in /in/uAYEf on line 25
Process exited with code 255.

preferences:
112.71 ms | 2831 KiB | 4 Q