3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { const TABLE = 'posts'; const TYPE = 'post'; static public function all() { $select = "SELECT * FROM `%s` WHERE `type` = '%s'\n"; echo sprintf($select, self::TABLE, self::TYPE); } } Post::all(); class Comment extends Post { const TYPE = 'comment'; } Comment::all();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4DYF8
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_STATIC_METHOD_CALL                                  'Post', 'all'
          1        DO_FCALL                                      0          
   19     2        INIT_STATIC_METHOD_CALL                                  'Comment', 'all'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Class Post:
Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4DYF8
function name:  all
number of ops:  8
compiled vars:  !0 = $select
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'SELECT+%2A+FROM+%60%25s%60+WHERE+%60type%60+%3D+%27%25s%27%0A'
    9     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'posts'
          4        SEND_VAL                                                 'post'
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
   10     7      > RETURN                                                   null

End of function all

End of class Post.

Class Comment:
Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4DYF8
function name:  all
number of ops:  8
compiled vars:  !0 = $select
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'SELECT+%2A+FROM+%60%25s%60+WHERE+%60type%60+%3D+%27%25s%27%0A'
    9     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'posts'
          4        SEND_VAL                                                 'post'
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
   10     7      > RETURN                                                   null

End of function all

End of class Comment.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.25 ms | 1396 KiB | 15 Q