3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassName1 { function __destruct() { print "Destroying " . __CLASS__ . "\n"; } } $fiber = new Fiber( function() { $d1 = new ClassName1; // Resulted output $d2 = \WeakReference::create(\Fiber::getCurrent())->get(); // expected output //\WeakReference::create(\Fiber::getCurrent())->get(); Fiber::suspend(); return ; } ); echo "1\n"; $fiber->start(); echo "2\n"; $fiber = null; echo "3\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCiiQ
function name:  (null)
number of ops:  12
compiled vars:  !0 = $fiber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'Fiber'
   13     1        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   24     2        SEND_VAL_EX                                              ~2
   12     3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   26     5        ECHO                                                     '1%0A'
   27     6        INIT_METHOD_CALL                                         !0, 'start'
          7        DO_FCALL                                      0          
   29     8        ECHO                                                     '2%0A'
   30     9        ASSIGN                                                   !0, null
   32    10        ECHO                                                     '3%0A'
         11      > 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/JCiiQ
function name:  {closure}
number of ops:  15
compiled vars:  !0 = $d1, !1 = $d2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'ClassName1'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   17     3        INIT_STATIC_METHOD_CALL                                  'WeakReference', 'create'
          4        INIT_STATIC_METHOD_CALL                                  'Fiber', 'getCurrent'
          5        DO_FCALL                                      0  $5      
          6        SEND_VAR                                                 $5
          7        DO_FCALL                                      0  $6      
          8        INIT_METHOD_CALL                                         $6, 'get'
          9        DO_FCALL                                      0  $7      
         10        ASSIGN                                                   !1, $7
   22    11        INIT_STATIC_METHOD_CALL                                  'Fiber', 'suspend'
         12        DO_FCALL                                      0          
   23    13      > RETURN                                                   null
   24    14*     > RETURN                                                   null

End of Dynamic Function 0

Class ClassName1:
Function __destruct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JCiiQ
function name:  __destruct
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'Destroying+ClassName1%0A'
    8     1      > RETURN                                                   null

End of function __destruct

End of class ClassName1.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.2 ms | 1008 KiB | 13 Q