3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace HHVM\UserDocumentation\Inconsistencies\Intro\Examples\AIC; $x = [0, 1]; next($x); // internal array cursor points at 1 next($x); // internal array cursor points after last element $y = $x; $y[] = 2; // Triggers copy-on-write var_dump(current($x)); // bool(false) var_dump(current($y)); // int(2) on HHVM, int(0) on PHP
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QOOGA
function name:  (null)
number of ops:  23
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    6     1        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Cnext'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
    7     4        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Cnext'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
    8     7        ASSIGN                                                   !1, !0
    9     8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  2
   11    10        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Cvar_dump'
         11        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Ccurrent'
         12        SEND_VAR_EX                                              !0
         13        DO_FCALL                                      0  $7      
         14        SEND_VAR_NO_REF_EX                                       $7
         15        DO_FCALL                                      0          
   12    16        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Cvar_dump'
         17        INIT_NS_FCALL_BY_NAME                                    'HHVM%5CUserDocumentation%5CInconsistencies%5CIntro%5CExamples%5CAIC%5Ccurrent'
         18        SEND_VAR_EX                                              !1
         19        DO_FCALL                                      0  $9      
         20        SEND_VAR_NO_REF_EX                                       $9
         21        DO_FCALL                                      0          
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.6 ms | 1395 KiB | 19 Q