3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyDummyWrapper { /** @var resource */ public $context; public function stream_open() { return true; } public function __call($m, $v): void { var_dump([$m, $v]); } } ini_set('open_basedir', __DIR__); stream_wrapper_register('foo', MyDummyWrapper::class); file_get_contents('foo://test'); ini_set('error_log', 'foo://test');
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.14
array(2) { [0]=> string(11) "stream_stat" [1]=> array(0) { } } array(2) { [0]=> string(11) "stream_read" [1]=> array(1) { [0]=> int(8192) } } array(2) { [0]=> string(10) "stream_eof" [1]=> array(0) { } } array(2) { [0]=> string(12) "stream_close" [1]=> array(0) { } } Warning: ini_set(): open_basedir restriction in effect. File(foo://test) is not within the allowed path(s): (/in) in /in/AEfvC on line 24

preferences:
85.69 ms | 407 KiB | 5 Q