3v4l.org

run code in 300+ PHP versions simultaneously
<?php class dumpy { function __construct() { echo 'constructor called,' . PHP_EOL . ' my class is ' . var_export(get_class($this), true) . PHP_EOL . ' input parameters: ' . var_export(func_get_args(), true) . PHP_EOL; } function __set($name, $value) { echo var_export($name, true) . ' = ' . var_export($value, true) . PHP_EOL; } } class dummy extends dumpy { } $dsn = 'sqlite::memory:'; $pdo = method_exists('PDO', 'connect') ? PDO::connect($dsn) : new PDO($dsn); $sql = "SELECT 'dummy' pdoFetchClassTypeClass, 'bar' foo, 'dfg' abc;"; foreach (array( array('PDO::FETCH_CLASS'), array('PDO::FETCH_CLASS', 'PDO::FETCH_PROPS_LATE'), array('PDO::FETCH_CLASS', 'PDO::FETCH_CLASSTYPE'), array('PDO::FETCH_CLASS', 'PDO::FETCH_CLASSTYPE', 'PDO::FETCH_PROPS_LATE'), ) as $fetchMode) { $fetchModeInt = 0; foreach (array_map('constant', $fetchMode) as $i) { $fetchModeInt |= $i; } echo '## ' . implode(' | ' , $fetchMode) . " ($fetchModeInt)" . PHP_EOL; $pdo->query($sql)->fetchAll( $fetchModeInt, 'dumpy', array('constructor argument #1') ); echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 11
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 50
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 50
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 28
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 50
Branch analysis from position: 18
Branch analysis from position: 50
filename:       /in/4flGD
function name:  (null)
number of ops:  52
compiled vars:  !0 = $dsn, !1 = $pdo, !2 = $sql, !3 = $fetchMode, !4 = $fetchModeInt, !5 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ASSIGN                                                   !0, 'sqlite%3A%3Amemory%3A'
   18     1        INIT_FCALL                                               'method_exists'
          2        SEND_VAL                                                 'PDO'
          3        SEND_VAL                                                 'connect'
          4        DO_ICALL                                         $7      
          5      > JMPZ                                                     $7, ->11
          6    >   INIT_STATIC_METHOD_CALL                                  'PDO', 'connect'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $8      
          9        QM_ASSIGN                                        ~9      $8
         10      > JMP                                                      ->15
         11    >   NEW                                              $10     'PDO'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0          
         14        QM_ASSIGN                                        ~9      $10
         15    >   ASSIGN                                                   !1, ~9
   19    16        ASSIGN                                                   !2, 'SELECT+%27dummy%27+pdoFetchClassTypeClass%2C+%27bar%27+foo%2C+%27dfg%27+abc%3B'
   22    17      > FE_RESET_R                                       $14     <array>, ->50
         18    > > FE_FETCH_R                                               $14, !3, ->50
   27    19    >   ASSIGN                                                   !4, 0
   28    20        INIT_FCALL                                               'array_map'
         21        SEND_VAL                                                 'constant'
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $16     
         24      > FE_RESET_R                                       $17     $16, ->28
         25    > > FE_FETCH_R                                               $17, !5, ->28
   29    26    >   ASSIGN_OP                                     9          !4, !5
   28    27      > JMP                                                      ->25
         28    >   FE_FREE                                                  $17
   31    29        INIT_FCALL                                               'implode'
         30        SEND_VAL                                                 '+%7C+'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                         $19     
         33        CONCAT                                           ~20     '%23%23+', $19
         34        ROPE_INIT                                     3  ~22     '+%28'
         35        ROPE_ADD                                      1  ~22     ~22, !4
         36        ROPE_END                                      2  ~21     ~22, '%29'
         37        CONCAT                                           ~24     ~20, ~21
         38        CONCAT                                           ~25     ~24, '%0A'
         39        ECHO                                                     ~25
   32    40        INIT_METHOD_CALL                                         !1, 'query'
         41        SEND_VAR_EX                                              !2
         42        DO_FCALL                                      0  $26     
         43        INIT_METHOD_CALL                                         $26, 'fetchAll'
   33    44        SEND_VAR_EX                                              !4
   34    45        SEND_VAL_EX                                              'dumpy'
   35    46        SEND_VAL_EX                                              <array>
   32    47        DO_FCALL                                      0          
   37    48        ECHO                                                     '%0A'
   22    49      > JMP                                                      ->18
         50    >   FE_FREE                                                  $14
   38    51      > RETURN                                                   1

Class dumpy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4flGD
function name:  __construct
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_export'
          1        FETCH_THIS                                       ~0      
          2        GET_CLASS                                        ~1      ~0
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      'constructor+called%2C%0A++my+class+is+', $2
          7        CONCAT                                           ~4      ~3, '%0A'
    6     8        CONCAT                                           ~5      ~4, '++input+parameters%3A+'
    7     9        INIT_FCALL                                               'var_export'
         10        FUNC_GET_ARGS                                    ~6      
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $7      
         14        CONCAT                                           ~8      ~5, $7
         15        CONCAT                                           ~9      ~8, '%0A'
         16        ECHO                                                     ~9
    8    17      > RETURN                                                   null

End of function __construct

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4flGD
function name:  __set
number of ops:  15
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'var_export'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '+%3D+'
          7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $4      
         11        CONCAT                                           ~5      ~3, $4
   11    12        CONCAT                                           ~6      ~5, '%0A'
         13        ECHO                                                     ~6
   12    14      > RETURN                                                   null

End of function __set

End of class dumpy.

Class dummy:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4flGD
function name:  __construct
number of ops:  18
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_export'
          1        FETCH_THIS                                       ~0      
          2        GET_CLASS                                        ~1      ~0
          3        SEND_VAL                                                 ~1
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      'constructor+called%2C%0A++my+class+is+', $2
          7        CONCAT                                           ~4      ~3, '%0A'
    6     8        CONCAT                                           ~5      ~4, '++input+parameters%3A+'
    7     9        INIT_FCALL                                               'var_export'
         10        FUNC_GET_ARGS                                    ~6      
         11        SEND_VAL                                                 ~6
         12        SEND_VAL                                                 <true>
         13        DO_ICALL                                         $7      
         14        CONCAT                                           ~8      ~5, $7
         15        CONCAT                                           ~9      ~8, '%0A'
         16        ECHO                                                     ~9
    8    17      > RETURN                                                   null

End of function __construct

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4flGD
function name:  __set
number of ops:  15
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        INIT_FCALL                                               'var_export'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '+%3D+'
          7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 <true>
         10        DO_ICALL                                         $4      
         11        CONCAT                                           ~5      ~3, $4
   11    12        CONCAT                                           ~6      ~5, '%0A'
         13        ECHO                                                     ~6
   12    14      > RETURN                                                   null

End of function __set

End of class dummy.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.61 ms | 1021 KiB | 17 Q