3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { protected $fillable = [ 'title', // ... ]; // ... } class Comment { protected $fillable = [ 'title', 'post_id', 'some_other_column', // ... ]; protected $appends = [ 'title' ]; protected $with = [ 'post' ]; public function __construct() { echo 'I should not construct!'; } public function post() : void { // ... } public function getPostAttribute() : ?string { return $this->post->title ?? null; } } var_export((new ReflectionClass(Comment::class))->getDefaultProperties()['fillable']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bEnRq
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   46     0  E >   INIT_FCALL                                               'var_export'
          1        NEW                                              $0      'ReflectionClass'
          2        SEND_VAL_EX                                              'Comment'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'getDefaultProperties'
          5        DO_FCALL                                      0  $2      
          6        FETCH_DIM_R                                      ~3      $2, 'fillable'
          7        SEND_VAL                                                 ~3
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Class Post: [no user functions]
Class Comment:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bEnRq
function name:  __construct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ECHO                                                     'I+should+not+construct%21'
   33     1      > RETURN                                                   null

End of function __construct

Function post:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bEnRq
function name:  post
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E > > RETURN                                                   null

End of function post

Function getpostattribute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bEnRq
function name:  getPostAttribute
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   FETCH_OBJ_IS                                     ~0      'post'
          1        FETCH_OBJ_IS                                     ~1      ~0, 'title'
          2        COALESCE                                         ~2      ~1
          3        QM_ASSIGN                                        ~2      null
          4        VERIFY_RETURN_TYPE                                       ~2
          5      > RETURN                                                   ~2
   43     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function getpostattribute

End of class Comment.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.76 ms | 1001 KiB | 14 Q