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");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vNhNa
function name:  (null)
number of ops:  40
compiled vars:  !0 = $result, !1 = $sth
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ECHO                                                     'PDO%3A%3AFETCH_ASSOC%3A+'
    4     1        ECHO                                                     'Return+next+row+as+an+array+indexed+by+column+name%0A'
    5     2        INIT_METHOD_CALL                                         !1, 'fetch'
          3        SEND_VAL_EX                                              2
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
    6     6        INIT_FCALL                                               'print_r'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
    7     9        ECHO                                                     '%0A'
    9    10        ECHO                                                     'PDO%3A%3AFETCH_BOTH%3A+'
   10    11        ECHO                                                     'Return+next+row+as+an+array+indexed+by+both+column+name+and+number%0A'
   11    12        INIT_METHOD_CALL                                         !1, 'fetch'
         13        SEND_VAL_EX                                              4
         14        DO_FCALL                                      0  $5      
         15        ASSIGN                                                   !0, $5
   12    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   13    19        ECHO                                                     '%0A'
   15    20        ECHO                                                     'PDO%3A%3AFETCH_LAZY%3A+'
   16    21        ECHO                                                     'Return+next+row+as+an+anonymous+object+with+column+names+as+properties%0A'
   17    22        INIT_METHOD_CALL                                         !1, 'fetch'
         23        SEND_VAL_EX                                              1
         24        DO_FCALL                                      0  $8      
         25        ASSIGN                                                   !0, $8
   18    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
   19    29        ECHO                                                     '%0A'
   21    30        ECHO                                                     'PDO%3A%3AFETCH_OBJ%3A+'
   22    31        ECHO                                                     'Return+next+row+as+an+anonymous+object+with+column+names+as+properties%0A'
   23    32        INIT_METHOD_CALL                                         !1, 'fetch'
         33        SEND_VAL_EX                                              5
         34        DO_FCALL                                      0  $11     
         35        ASSIGN                                                   !0, $11
   24    36        FETCH_OBJ_R                                      ~13     !0, 'NAME'
         37        ECHO                                                     ~13
   25    38        ECHO                                                     '%0A'
         39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163 ms | 1396 KiB | 15 Q