3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function sum_int(int $a, int $b) : int { return $a + $b; } function sum_float(float $a, float $b) : float { return $a + $b; } function substract_int(int $a, int $b) : int { return $a - $b; } function substract_float(float $a, float $b) : float { return $a - $b; } function multiply_int(int $a, int $b) : int { return $a * $b; } function multiply_float(float $a, float $b) : float { return $a * $b; } function divide_int(int $a, int $b) : int { return $b == 0 ? $a : $a / $b; } function divide_float(float $a, float $b) : float { return $b == 0 ? $a : $a / $b; } echo "La somme de 9 + 14 = " . sum_int(9, 14) . "\r\n"; echo "La somme de 1.895 + 8.105 = " . sum_int(1.895, 8.105) . "\r\n"; echo "La soustraction de 9 - 14 = " . substract_int(9, 14) . "\r\n"; echo "La soustraction de 1.895 - 8.105 = " . substract_int(1.895, 8.105) . "\r\n"; echo "La multiplication de 9 * 14 = " . multiply_int(9, 14) . "\r\n"; echo "La multiplication de 1.895 * 8.105 = " . multiply_int(1.895, 8.105) . "\r\n"; echo "La division de 9 / 14 = " . divide_int(9, 0) . "\r\n"; echo "La division de 1.895 / 8.105 = " . divide_int(1.895, 0) . "\r\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  (null)
number of ops:  57
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   INIT_FCALL                                               'sum_int'
          1        SEND_VAL                                                 9
          2        SEND_VAL                                                 14
          3        DO_FCALL                                      0  $0      
          4        CONCAT                                           ~1      'La+somme+de+9+%2B+14+++++++++++++++++%3D+', $0
          5        CONCAT                                           ~2      ~1, '%0D%0A'
          6        ECHO                                                     ~2
   31     7        INIT_FCALL                                               'sum_int'
          8        SEND_VAL                                                 1.895
          9        SEND_VAL                                                 8.105
         10        DO_FCALL                                      0  $3      
         11        CONCAT                                           ~4      'La+somme+de+1.895+%2B+8.105++++++++++%3D+', $3
         12        CONCAT                                           ~5      ~4, '%0D%0A'
         13        ECHO                                                     ~5
   32    14        INIT_FCALL                                               'substract_int'
         15        SEND_VAL                                                 9
         16        SEND_VAL                                                 14
         17        DO_FCALL                                      0  $6      
         18        CONCAT                                           ~7      'La+soustraction+de+9+-+14++++++++++%3D+', $6
         19        CONCAT                                           ~8      ~7, '%0D%0A'
         20        ECHO                                                     ~8
   33    21        INIT_FCALL                                               'substract_int'
         22        SEND_VAL                                                 1.895
         23        SEND_VAL                                                 8.105
         24        DO_FCALL                                      0  $9      
         25        CONCAT                                           ~10     'La+soustraction+de+1.895+-+8.105+++%3D+', $9
         26        CONCAT                                           ~11     ~10, '%0D%0A'
         27        ECHO                                                     ~11
   34    28        INIT_FCALL                                               'multiply_int'
         29        SEND_VAL                                                 9
         30        SEND_VAL                                                 14
         31        DO_FCALL                                      0  $12     
         32        CONCAT                                           ~13     'La+multiplication+de+9+%2A+14++++++++%3D+', $12
         33        CONCAT                                           ~14     ~13, '%0D%0A'
         34        ECHO                                                     ~14
   35    35        INIT_FCALL                                               'multiply_int'
         36        SEND_VAL                                                 1.895
         37        SEND_VAL                                                 8.105
         38        DO_FCALL                                      0  $15     
         39        CONCAT                                           ~16     'La+multiplication+de+1.895+%2A+8.105+%3D+', $15
         40        CONCAT                                           ~17     ~16, '%0D%0A'
         41        ECHO                                                     ~17
   36    42        INIT_FCALL                                               'divide_int'
         43        SEND_VAL                                                 9
         44        SEND_VAL                                                 0
         45        DO_FCALL                                      0  $18     
         46        CONCAT                                           ~19     'La+division+de+9+%2F+14++++++++++++++%3D+', $18
         47        CONCAT                                           ~20     ~19, '%0D%0A'
         48        ECHO                                                     ~20
   37    49        INIT_FCALL                                               'divide_int'
         50        SEND_VAL                                                 1.895
         51        SEND_VAL                                                 0
         52        DO_FCALL                                      0  $21     
         53        CONCAT                                           ~22     'La+division+de+1.895+%2F+8.105+++++++%3D+', $21
         54        CONCAT                                           ~23     ~22, '%0D%0A'
         55        ECHO                                                     ~23
         56      > RETURN                                                   1

Function sum_int:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  sum_int
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        ADD                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
    7     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function sum_int

Function sum_float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  sum_float
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        ADD                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   10     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function sum_float

Function substract_int:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  substract_int
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   12     2        SUB                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   13     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function substract_int

Function substract_float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  substract_float
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        SUB                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   16     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function substract_float

Function multiply_int:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  multiply_int
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        MUL                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   19     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function multiply_int

Function multiply_float:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  multiply_float
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   21     2        MUL                                              ~2      !0, !1
          3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   22     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function multiply_float

Function divide_int:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  divide_int
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        IS_EQUAL                                                 !1, 0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      !0
          5      > JMP                                                      ->8
          6    >   DIV                                              ~4      !0, !1
          7        QM_ASSIGN                                        ~3      ~4
          8    >   VERIFY_RETURN_TYPE                                       ~3
          9      > RETURN                                                   ~3
   25    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function divide_int

Function divide_float:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mYiNa
function name:  divide_float
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   27     2        IS_EQUAL                                                 !1, 0
          3      > JMPZ                                                     ~2, ->6
          4    >   QM_ASSIGN                                        ~3      !0
          5      > JMP                                                      ->8
          6    >   DIV                                              ~4      !0, !1
          7        QM_ASSIGN                                        ~3      ~4
          8    >   VERIFY_RETURN_TYPE                                       ~3
          9      > RETURN                                                   ~3
   28    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function divide_float

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.61 ms | 1402 KiB | 21 Q