3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface foo { function fetch($how = NULL, $orientation = NULL, $offset = NULL); } class bar extends PDOStatement implements foo { function fetch($how = NULL, $orientation = NULL, $offset = NULL) { print'fetch'; parent::fetch($how, $orientation, $offset); } } $bar = new bar(); $bar->fetch(); ?>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Return type of bar::fetch($how = null, $orientation = null, $offset = null) should either be compatible with PDOStatement::fetch(int $mode = PDO::FETCH_DEFAULT, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/YVHqv on line 6 fetch Deprecated: PDOStatement::fetch(): Passing null to parameter #1 ($mode) of type int is deprecated in /in/YVHqv on line 8 Deprecated: PDOStatement::fetch(): Passing null to parameter #2 ($cursorOrientation) of type int is deprecated in /in/YVHqv on line 8 Deprecated: PDOStatement::fetch(): Passing null to parameter #3 ($cursorOffset) of type int is deprecated in /in/YVHqv on line 8 Fatal error: Uncaught Error: PDO object is uninitialized in /in/YVHqv:8 Stack trace: #0 /in/YVHqv(8): PDOStatement->fetch(NULL, NULL, NULL) #1 /in/YVHqv(12): bar->fetch() #2 {main} thrown in /in/YVHqv on line 8
Process exited with code 255.
Output for 8.0.0 - 8.0.30
fetch Fatal error: Uncaught Error: PDO object is uninitialized in /in/YVHqv:8 Stack trace: #0 /in/YVHqv(8): PDOStatement->fetch(NULL, NULL, NULL) #1 /in/YVHqv(12): bar->fetch() #2 {main} thrown in /in/YVHqv on line 8
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.35, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
fetch
Output for 5.0.0 - 5.0.5
<br /> <b>Fatal error</b>: Class 'PDOStatement' not found in <b>/in/YVHqv</b> on line <b>5</b><br />
Process exited with code 255.
Output for 4.4.2 - 4.4.9
<br /> <b>Parse error</b>: syntax error, unexpected T_STRING in <b>/in/YVHqv</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
<br /> <b>Parse error</b>: parse error, unexpected T_STRING in <b>/in/YVHqv</b> on line <b>2</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error in <b>/in/YVHqv</b> on line <b>2</b><br />
Process exited with code 255.

preferences:
281.77 ms | 401 KiB | 346 Q