3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { public function __get($var) { return true; // Different error return false; // Error return null; // Error return 0; // Different error return 1; // Different error return new StdClass(); // Different error } } // Different error is: Cannot use scalar value as an array // Using new StdClass it isn't scalar, but object $t = new test(); //$t->arr[0] = 1; // Error //$t->arr[0]; // No error $t->a; // No error $t->a = 1; // No error
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1sYgt
function name:  (null)
number of ops:  8
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $1      'test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        FETCH_OBJ_R                                      ~4      !0, 'a'
          4        FREE                                                     ~4
   22     5        ASSIGN_OBJ                                               !0, 'a'
          6        OP_DATA                                                  1
          7      > RETURN                                                   1

Class test:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1sYgt
function name:  __get
number of ops:  10
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > RETURN                                                   <true>
    6     2*       RETURN                                                   <false>
    7     3*       RETURN                                                   null
    8     4*       RETURN                                                   0
    9     5*       RETURN                                                   1
   10     6*       NEW                                              $1      'StdClass'
          7*       DO_FCALL                                      0          
          8*       RETURN                                                   $1
   11     9*     > RETURN                                                   null

End of function __get

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.4 ms | 1385 KiB | 13 Q