3v4l.org

run code in 300+ PHP versions simultaneously
<?php print("PDO::FETCH_ASSOC: "); print("Return next row as an array indexed by column name\n"); $result = $sth->fetch(PDO::FETCH_ASSOC); print_r($result); print("\n"); print("PDO::FETCH_BOTH: "); print("Return next row as an array indexed by both column name and number\n"); $result = $sth->fetch(PDO::FETCH_BOTH); print_r($result); print("\n"); print("PDO::FETCH_LAZY: "); print("Return next row as an anonymous object with column names as properties\n"); $result = $sth->fetch(PDO::FETCH_LAZY); print_r($result); print("\n"); print("PDO::FETCH_OBJ: "); print("Return next row as an anonymous object with column names as properties\n"); $result = $sth->fetch(PDO::FETCH_OBJ); print $result->NAME; print("\n");
Output for git.master, git.master_jit, rfc.property-hooks
PDO::FETCH_ASSOC: Return next row as an array indexed by column name Warning: Undefined variable $sth in /in/vNhNa on line 5 Fatal error: Uncaught Error: Call to a member function fetch() on null in /in/vNhNa:5 Stack trace: #0 {main} thrown in /in/vNhNa on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.51 ms | 401 KiB | 8 Q