3v4l.org

run code in 300+ PHP versions simultaneously
<?php assert_options(ASSERT_ACTIVE, 1); class foo { public $foo = 1; function as_string() { assert('$this->foo == 1'); } function as_expr() { assert($this->foo == 1); } } $foo = new foo(); $foo->as_expr(); $foo->as_string();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IDV0S
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'assert_options'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
   14     4        NEW                                              $2      'foo'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $2
   15     7        INIT_METHOD_CALL                                         !0, 'as_expr'
          8        DO_FCALL                                      0          
   16     9        INIT_METHOD_CALL                                         !0, 'as_string'
         10        DO_FCALL                                      0          
         11      > RETURN                                                   1

Class foo:
Function as_string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IDV0S
function name:  as_string
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSERT_CHECK                                             
          1        INIT_FCALL                                               'assert'
          2        SEND_VAL                                                 '%24this-%3Efoo+%3D%3D+1'
          3        SEND_VAL                                                 'assert%28%27%24this-%3Efoo+%3D%3D+1%27%29'
          4        DO_ICALL                                                 
          5      > RETURN                                                   null

End of function as_string

Function as_expr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IDV0S
function name:  as_expr
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSERT_CHECK                                             
          1        INIT_FCALL                                               'assert'
          2        FETCH_OBJ_R                                      ~0      'foo'
          3        IS_EQUAL                                         ~1      ~0, 1
          4        SEND_VAL                                                 ~1
          5        SEND_VAL                                                 'assert%28%24this-%3Efoo+%3D%3D+1%29'
          6        DO_ICALL                                                 
          7      > RETURN                                                   null

End of function as_expr

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.38 ms | 1396 KiB | 17 Q