3v4l.org

run code in 300+ PHP versions simultaneously
<?php +var_dump(intdiv(3, 2)); +var_dump(intdiv(-3, 2)); +var_dump(intdiv(3, -2)); +var_dump(intdiv(-3, -2)); +var_dump(intdiv(PHP_INT_MAX, PHP_INT_MAX)); +var_dump(intdiv(-PHP_INT_MAX - 1, -PHP_INT_MAX - 1)); +var_dump(intdiv(-PHP_INT_MAX - 1, -1)); +var_dump(intdiv(1, 0));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u0bgg
function name:  (null)
number of ops:  73
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'intdiv'
          2        SEND_VAL                                                 3
          3        SEND_VAL                                                 2
          4        DO_ICALL                                         $0      
          5        SEND_VAR                                                 $0
          6        DO_ICALL                                         $1      
          7        MUL                                              ~2      $1, 1
          8        FREE                                                     ~2
    3     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'intdiv'
         11        SEND_VAL                                                 -3
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $3      
         14        SEND_VAR                                                 $3
         15        DO_ICALL                                         $4      
         16        MUL                                              ~5      $4, 1
         17        FREE                                                     ~5
    4    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'intdiv'
         20        SEND_VAL                                                 3
         21        SEND_VAL                                                 -2
         22        DO_ICALL                                         $6      
         23        SEND_VAR                                                 $6
         24        DO_ICALL                                         $7      
         25        MUL                                              ~8      $7, 1
         26        FREE                                                     ~8
    5    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'intdiv'
         29        SEND_VAL                                                 -3
         30        SEND_VAL                                                 -2
         31        DO_ICALL                                         $9      
         32        SEND_VAR                                                 $9
         33        DO_ICALL                                         $10     
         34        MUL                                              ~11     $10, 1
         35        FREE                                                     ~11
    6    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'intdiv'
         38        SEND_VAL                                                 9223372036854775807
         39        SEND_VAL                                                 9223372036854775807
         40        DO_ICALL                                         $12     
         41        SEND_VAR                                                 $12
         42        DO_ICALL                                         $13     
         43        MUL                                              ~14     $13, 1
         44        FREE                                                     ~14
    7    45        INIT_FCALL                                               'var_dump'
         46        INIT_FCALL                                               'intdiv'
         47        SEND_VAL                                                 -9223372036854775808
         48        SEND_VAL                                                 -9223372036854775808
         49        DO_ICALL                                         $15     
         50        SEND_VAR                                                 $15
         51        DO_ICALL                                         $16     
         52        MUL                                              ~17     $16, 1
         53        FREE                                                     ~17
    8    54        INIT_FCALL                                               'var_dump'
         55        INIT_FCALL                                               'intdiv'
         56        SEND_VAL                                                 -9223372036854775808
         57        SEND_VAL                                                 -1
         58        DO_ICALL                                         $18     
         59        SEND_VAR                                                 $18
         60        DO_ICALL                                         $19     
         61        MUL                                              ~20     $19, 1
         62        FREE                                                     ~20
    9    63        INIT_FCALL                                               'var_dump'
         64        INIT_FCALL                                               'intdiv'
         65        SEND_VAL                                                 1
         66        SEND_VAL                                                 0
         67        DO_ICALL                                         $21     
         68        SEND_VAR                                                 $21
         69        DO_ICALL                                         $22     
         70        MUL                                              ~23     $22, 1
         71        FREE                                                     ~23
         72      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.13 ms | 1465 KiB | 15 Q