3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __set($prop, $value) { echo "__set($prop, $value)\n"; Fiber::suspend(); } } $foo = new Foo(); $fiber = new Fiber(function () use ($foo) { $foo->bar = 'bar'; }); $value = $fiber->start(); $foo->bar = 'baz'; $fiber->resume('test');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KH2oE
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        ASSIGN_OBJ                                               !0, 'bar'
         13        OP_DATA                                                  'baz'
   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/KH2oE
function name:  {closure}
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        ASSIGN_OBJ                                               !0, 'bar'
          2        OP_DATA                                                  'bar'
   14     3      > RETURN                                                   null

End of Dynamic Function 0

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

End of function __set

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.7 ms | 1443 KiB | 13 Q