3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TestClass { public function testPushAndPop() { $stack = array(); $this->assertEquals(0, count($stack)); array_push($stack, 'foo'); $this->assertEquals('foo', $stack[count($stack)-1]); $this->assertEquals(1, count($stack)); $this->assertEquals('foo', array_pop($stack)); $this->assertEquals(0, count($stack)); } } TestClass.testPushAndPop(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aWAD9
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_CONSTANT                                   ~0      'TestClass'
          1        INIT_FCALL_BY_NAME                                       'testPushAndPop'
          2        DO_FCALL                                      0  $1      
          3        CONCAT                                           ~2      ~0, $1
          4        FREE                                                     ~2
   20     5      > RETURN                                                   1

Class TestClass:
Function testpushandpop:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aWAD9
function name:  testPushAndPop
number of ops:  36
compiled vars:  !0 = $stack
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_METHOD_CALL                                         'assertEquals'
          2        SEND_VAL_EX                                              0
          3        COUNT                                            ~2      !0
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   10     6        INIT_FCALL                                               'array_push'
          7        SEND_REF                                                 !0
          8        SEND_VAL                                                 'foo'
          9        DO_ICALL                                                 
   11    10        INIT_METHOD_CALL                                         'assertEquals'
         11        SEND_VAL_EX                                              'foo'
         12        CHECK_FUNC_ARG                                           
         13        COUNT                                            ~5      !0
         14        SUB                                              ~6      ~5, 1
         15        FETCH_DIM_FUNC_ARG                               $7      !0, ~6
         16        SEND_FUNC_ARG                                            $7
         17        DO_FCALL                                      0          
   12    18        INIT_METHOD_CALL                                         'assertEquals'
         19        SEND_VAL_EX                                              1
         20        COUNT                                            ~9      !0
         21        SEND_VAL_EX                                              ~9
         22        DO_FCALL                                      0          
   14    23        INIT_METHOD_CALL                                         'assertEquals'
         24        SEND_VAL_EX                                              'foo'
         25        INIT_FCALL                                               'array_pop'
         26        SEND_REF                                                 !0
         27        DO_ICALL                                         $11     
         28        SEND_VAR_NO_REF_EX                                       $11
         29        DO_FCALL                                      0          
   15    30        INIT_METHOD_CALL                                         'assertEquals'
         31        SEND_VAL_EX                                              0
         32        COUNT                                            ~13     !0
         33        SEND_VAL_EX                                              ~13
         34        DO_FCALL                                      0          
   16    35      > RETURN                                                   null

End of function testpushandpop

End of class TestClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.76 ms | 1392 KiB | 17 Q