3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function __get($prop) { echo "__set($prop)\n"; Fiber::suspend(); } } $foo = new Foo(); $fiber = new Fiber(function () use ($foo) { $foo->bar; }); $value = $fiber->start(); $foo->bar; $fiber->resume('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ju5mp
function name:  (null)
number of ops:  18
compiled vars:  !0 = $foo, !1 = $fiber, !2 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   NEW                                                  $3      'Foo'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $3
   12     3        NEW                                                  $6      'Fiber'
          4        DECLARE_LAMBDA_FUNCTION                              ~7      [0]
          5        BIND_LEXICAL                                                 ~7, !0
   14     6        SEND_VAL_EX                                                  ~7
   12     7        DO_FCALL                                          0          
          8        ASSIGN                                                       !1, $6
   16     9        INIT_METHOD_CALL                                             !1, 'start'
         10        DO_FCALL                                          0  $10     
         11        ASSIGN                                                       !2, $10
   17    12        FETCH_OBJ_R                                          ~12     !0, 'bar'
         13        FREE                                                         ~12
   18    14        INIT_METHOD_CALL                                             !1, 'resume'
         15        SEND_VAL_EX                                                  'test'
         16        DO_FCALL                                          0          
         17      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ju5mp
function name:  {closure:/in/ju5mp:12}
number of ops:  4
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   BIND_STATIC                                                  !0
   13     1        FETCH_OBJ_R                                          ~1      !0, 'bar'
          2        FREE                                                         ~1
   14     3      > RETURN                                                       null

End of Dynamic Function 0

Class Foo:
Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ju5mp
function name:  __get
number of ops:  8
compiled vars:  !0 = $prop
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        ROPE_INIT                                         3  ~2      '__set%28'
          2        ROPE_ADD                                          1  ~2      ~2, !0
          3        ROPE_END                                          2  ~1      ~2, '%29%0A'
          4        ECHO                                                         ~1
    6     5        INIT_STATIC_METHOD_CALL                                      'Fiber', 'suspend'
          6        DO_FCALL                                          0          
    7     7      > RETURN                                                       null

End of function __get

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.77 ms | 1598 KiB | 13 Q