3v4l.org

run code in 300+ PHP versions simultaneously
<?php $PDO = new PDO('sqlite::memory:', null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); $PDO->exec('create table users(name text)'); $PDO->exec("insert into users values('alice'), ('bob')"); $user = $PDO->query('select name from users limit 1')->fetchObject(User::class); echo "Hello, {$user->getName()}!"; class User { protected $name; public function getName() : string { return $this->name; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NOLVd
function name:  (null)
number of ops:  27
compiled vars:  !0 = $PDO, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'PDO'
          1        SEND_VAL_EX                                              'sqlite%3A%3Amemory%3A'
          2        SEND_VAL_EX                                              null
          3        SEND_VAL_EX                                              null
          4        SEND_VAL_EX                                              <array>
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
    4     7        INIT_METHOD_CALL                                         !0, 'exec'
          8        SEND_VAL_EX                                              'create+table+users%28name+text%29'
          9        DO_FCALL                                      0          
    5    10        INIT_METHOD_CALL                                         !0, 'exec'
         11        SEND_VAL_EX                                              'insert+into+users+values%28%27alice%27%29%2C+%28%27bob%27%29'
         12        DO_FCALL                                      0          
    7    13        INIT_METHOD_CALL                                         !0, 'query'
         14        SEND_VAL_EX                                              'select+name+from+users+limit+1'
         15        DO_FCALL                                      0  $7      
         16        INIT_METHOD_CALL                                         $7, 'fetchObject'
         17        SEND_VAL_EX                                              'User'
         18        DO_FCALL                                      0  $8      
         19        ASSIGN                                                   !1, $8
    9    20        ROPE_INIT                                     3  ~12     'Hello%2C+'
         21        INIT_METHOD_CALL                                         !1, 'getName'
         22        DO_FCALL                                      0  $10     
         23        ROPE_ADD                                      1  ~12     ~12, $10
         24        ROPE_END                                      2  ~11     ~12, '%21'
         25        ECHO                                                     ~11
   16    26      > RETURN                                                   1

Class User:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NOLVd
function name:  getName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   15     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getname

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.53 ms | 1395 KiB | 13 Q