3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(list($serial) = sscanf("SN/2350001", "SN/%d")); die; function unserialize_handler($errno, $errstr) { echo "Сериализуемое значение недопустимо.\n"; } $serialized = 'foo'; set_error_handler('unserialize_handler'); $original = unserialize($serialized); restore_error_handler(); function print_line($fd, $events, $arg) { static $max_requests = 0; $max_requests++; if ($max_requests == 10) { // exit loop after 10 writes event_base_loopexit($arg[1]); } // print the line echo fgets($fd); } // create base and event $base = event_base_new(); $event = event_new(); $fd = STDIN; // set event flags event_set($event, $fd, EV_READ | EV_PERSIST, "print_line", array($event, $base)); // set event base event_base_set($event, $base); // enable event event_add($event); // start event loop event_base_loop($base);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/SkZCM
function name:  (null)
number of ops:  51
compiled vars:  !0 = $serial, !1 = $serialized, !2 = $original, !3 = $base, !4 = $event, !5 = $fd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'sscanf'
          2        SEND_VAL                                                 'SN%2F2350001'
          3        SEND_VAL                                                 'SN%2F%25d'
          4        DO_ICALL                                         $6      
          5        FETCH_LIST_R                                     $7      $6, 0
          6        ASSIGN                                                   !0, $7
          7        SEND_VAR                                                 $6
          8        DO_ICALL                                                 
    3     9      > EXIT                                                     
   12    10*       ASSIGN                                                   !1, 'foo'
   13    11*       INIT_FCALL                                               'set_error_handler'
         12*       SEND_VAL                                                 'unserialize_handler'
         13*       DO_ICALL                                                 
   14    14*       INIT_FCALL                                               'unserialize'
         15*       SEND_VAR                                                 !1
         16*       DO_ICALL                                         $12     
         17*       ASSIGN                                                   !2, $12
   15    18*       INIT_FCALL                                               'restore_error_handler'
         19*       DO_ICALL                                                 
   34    20*       INIT_FCALL_BY_NAME                                       'event_base_new'
         21*       DO_FCALL                                      0  $15     
         22*       ASSIGN                                                   !3, $15
   35    23*       INIT_FCALL_BY_NAME                                       'event_new'
         24*       DO_FCALL                                      0  $17     
         25*       ASSIGN                                                   !4, $17
   37    26*       FETCH_CONSTANT                                   ~19     'STDIN'
         27*       ASSIGN                                                   !5, ~19
   40    28*       INIT_FCALL_BY_NAME                                       'event_set'
         29*       SEND_VAR_EX                                              !4
         30*       SEND_VAR_EX                                              !5
         31*       FETCH_CONSTANT                                   ~21     'EV_READ'
         32*       FETCH_CONSTANT                                   ~22     'EV_PERSIST'
         33*       BW_OR                                            ~23     ~21, ~22
         34*       SEND_VAL_EX                                              ~23
         35*       SEND_VAL_EX                                              'print_line'
         36*       INIT_ARRAY                                       ~24     !4
         37*       ADD_ARRAY_ELEMENT                                ~24     !3
         38*       SEND_VAL_EX                                              ~24
         39*       DO_FCALL                                      0          
   42    40*       INIT_FCALL_BY_NAME                                       'event_base_set'
         41*       SEND_VAR_EX                                              !4
         42*       SEND_VAR_EX                                              !3
         43*       DO_FCALL                                      0          
   45    44*       INIT_FCALL_BY_NAME                                       'event_add'
         45*       SEND_VAR_EX                                              !4
         46*       DO_FCALL                                      0          
   47    47*       INIT_FCALL_BY_NAME                                       'event_base_loop'
         48*       SEND_VAR_EX                                              !3
         49*       DO_FCALL                                      0          
         50*     > RETURN                                                   1

Function unserialize_handler:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SkZCM
function name:  unserialize_handler
number of ops:  4
compiled vars:  !0 = $errno, !1 = $errstr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ECHO                                                     '%D0%A1%D0%B5%D1%80%D0%B8%D0%B0%D0%BB%D0%B8%D0%B7%D1%83%D0%B5%D0%BC%D0%BE%D0%B5+%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5+%D0%BD%D0%B5%D0%B4%D0%BE%D0%BF%D1%83%D1%81%D1%82%D0%B8%D0%BC%D0%BE.%0A'
   10     3      > RETURN                                                   null

End of function unserialize_handler

Function print_line:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/SkZCM
function name:  print_line
number of ops:  17
compiled vars:  !0 = $fd, !1 = $events, !2 = $arg, !3 = $max_requests
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   20     3        BIND_STATIC                                              !3
   22     4        PRE_INC                                                  !3
   24     5        IS_EQUAL                                                 !3, 10
          6      > JMPZ                                                     ~5, ->12
   26     7    >   INIT_FCALL_BY_NAME                                       'event_base_loopexit'
          8        CHECK_FUNC_ARG                                           
          9        FETCH_DIM_FUNC_ARG                               $6      !2, 1
         10        SEND_FUNC_ARG                                            $6
         11        DO_FCALL                                      0          
   30    12    >   INIT_FCALL                                               'fgets'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $8      
         15        ECHO                                                     $8
   31    16      > RETURN                                                   null

End of function print_line

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.02 ms | 1400 KiB | 25 Q