3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x1 = -2.1; $x2 = 0.6; $y1 = -1.2; $y2 = 1.2; $zoom = 100; $iterations_max = 50; $image_x = ($x2 - $x1)*$zoom; $image_y = ($y2 - $y1)*$zoom; // on créé l'image et les couleurs, inutile ici de remplire l'image vu que on dessinera tous les pixels $image = imagecreatetruecolor($image_x, $image_y); $blanc = imagecolorallocate($image, 255, 255, 255); $noir = imagecolorallocate($image, 0, 0, 0); imagefill($image, 0 ,0 , $blanc); // on définit la liste des couleurs du dégradé ici, ça évite de devoir faire appel à imagecoloralocate à chaque pixel $couleurs = array(); for($i = 0; $i < $iterations_max; $i++) $couleur[$i] = imagecolorallocate($image, 0, 0, $i*255/$iterations_max); $debut = microtime(true); for($x = 0; $x < $image_x; $x++){ for($y = 0; $y < $image_y; $y++){ $c_r = $x/$zoom+$x1; $c_i = $y/$zoom+$y1; $z_r = 0; $z_i = 0; $i = 0; do{ $tmp = $z_r; $z_r = $z_r*$z_r - $z_i*$z_i + $c_r; $z_i = 2*$tmp*$z_i + $c_i; $i++; } while($z_r*$z_r + $z_i*$z_i < 4 AND $i < $iterations_max); if($i == $iterations_max) imagesetpixel($image, $x, $y, $noir); else imagesetpixel($image, $x, $y, $couleur[$i]); } } $temps = round(microtime(true) - $debut, 3); imagestring($image, 3, 1, 1, $temps, $blanc); header('Content-type: image/png'); imagepng($image);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 40
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 59
Branch analysis from position: 112
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 107
Branch analysis from position: 107
2 jumps found. (Code = 44) Position 1 = 109, Position 2 = 61
Branch analysis from position: 109
2 jumps found. (Code = 44) Position 1 = 112, Position 2 = 59
Branch analysis from position: 112
Branch analysis from position: 59
Branch analysis from position: 61
2 jumps found. (Code = 46) Position 1 = 86, Position 2 = 88
Branch analysis from position: 86
2 jumps found. (Code = 44) Position 1 = 89, Position 2 = 70
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 91, Position 2 = 98
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 106
Branch analysis from position: 106
2 jumps found. (Code = 44) Position 1 = 109, Position 2 = 61
Branch analysis from position: 109
Branch analysis from position: 61
Branch analysis from position: 98
2 jumps found. (Code = 44) Position 1 = 109, Position 2 = 61
Branch analysis from position: 109
Branch analysis from position: 61
Branch analysis from position: 70
Branch analysis from position: 88
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 40
Branch analysis from position: 53
Branch analysis from position: 40
filename:       /in/2a7et
function name:  (null)
number of ops:  136
compiled vars:  !0 = $x1, !1 = $x2, !2 = $y1, !3 = $y2, !4 = $zoom, !5 = $iterations_max, !6 = $image_x, !7 = $image_y, !8 = $image, !9 = $blanc, !10 = $noir, !11 = $couleurs, !12 = $i, !13 = $couleur, !14 = $debut, !15 = $x, !16 = $y, !17 = $c_r, !18 = $c_i, !19 = $z_r, !20 = $z_i, !21 = $tmp, !22 = $temps
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, -2.1
    3     1        ASSIGN                                                   !1, 0.6
    4     2        ASSIGN                                                   !2, -1.2
    5     3        ASSIGN                                                   !3, 1.2
    6     4        ASSIGN                                                   !4, 100
    7     5        ASSIGN                                                   !5, 50
    9     6        SUB                                              ~29     !1, !0
          7        MUL                                              ~30     !4, ~29
          8        ASSIGN                                                   !6, ~30
   10     9        SUB                                              ~32     !3, !2
         10        MUL                                              ~33     !4, ~32
         11        ASSIGN                                                   !7, ~33
   13    12        INIT_FCALL_BY_NAME                                       'imagecreatetruecolor'
         13        SEND_VAR_EX                                              !6
         14        SEND_VAR_EX                                              !7
         15        DO_FCALL                                      0  $35     
         16        ASSIGN                                                   !8, $35
   14    17        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         18        SEND_VAR_EX                                              !8
         19        SEND_VAL_EX                                              255
         20        SEND_VAL_EX                                              255
         21        SEND_VAL_EX                                              255
         22        DO_FCALL                                      0  $37     
         23        ASSIGN                                                   !9, $37
   15    24        INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         25        SEND_VAR_EX                                              !8
         26        SEND_VAL_EX                                              0
         27        SEND_VAL_EX                                              0
         28        SEND_VAL_EX                                              0
         29        DO_FCALL                                      0  $39     
         30        ASSIGN                                                   !10, $39
   16    31        INIT_FCALL_BY_NAME                                       'imagefill'
         32        SEND_VAR_EX                                              !8
         33        SEND_VAL_EX                                              0
         34        SEND_VAL_EX                                              0
         35        SEND_VAR_EX                                              !9
         36        DO_FCALL                                      0          
   19    37        ASSIGN                                                   !11, <array>
   20    38        ASSIGN                                                   !12, 0
         39      > JMP                                                      ->51
   21    40    >   INIT_FCALL_BY_NAME                                       'imagecolorallocate'
         41        SEND_VAR_EX                                              !8
         42        SEND_VAL_EX                                              0
         43        SEND_VAL_EX                                              0
         44        MUL                                              ~45     !12, 255
         45        DIV                                              ~46     ~45, !5
         46        SEND_VAL_EX                                              ~46
         47        DO_FCALL                                      0  $47     
         48        ASSIGN_DIM                                               !13, !12
         49        OP_DATA                                                  $47
   20    50        PRE_INC                                                  !12
         51    >   IS_SMALLER                                               !12, !5
         52      > JMPNZ                                                    ~49, ->40
   23    53    >   INIT_FCALL                                               'microtime'
         54        SEND_VAL                                                 <true>
         55        DO_ICALL                                         $50     
         56        ASSIGN                                                   !14, $50
   24    57        ASSIGN                                                   !15, 0
         58      > JMP                                                      ->110
   25    59    >   ASSIGN                                                   !16, 0
         60      > JMP                                                      ->107
   26    61    >   DIV                                              ~54     !15, !4
         62        ADD                                              ~55     ~54, !0
         63        ASSIGN                                                   !17, ~55
   27    64        DIV                                              ~57     !16, !4
         65        ADD                                              ~58     ~57, !2
         66        ASSIGN                                                   !18, ~58
   28    67        ASSIGN                                                   !19, 0
   29    68        ASSIGN                                                   !20, 0
   30    69        ASSIGN                                                   !12, 0
   33    70    >   ASSIGN                                                   !21, !19
   34    71        MUL                                              ~64     !19, !19
         72        MUL                                              ~65     !20, !20
         73        SUB                                              ~66     ~64, ~65
         74        ADD                                              ~67     ~66, !17
         75        ASSIGN                                                   !19, ~67
   35    76        MUL                                              ~69     !21, 2
         77        MUL                                              ~70     !20, ~69
         78        ADD                                              ~71     ~70, !18
         79        ASSIGN                                                   !20, ~71
   36    80        PRE_INC                                                  !12
   37    81        MUL                                              ~74     !19, !19
         82        MUL                                              ~75     !20, !20
         83        ADD                                              ~76     ~74, ~75
         84        IS_SMALLER                                       ~77     ~76, 4
         85      > JMPZ_EX                                          ~77     ~77, ->88
         86    >   IS_SMALLER                                       ~78     !12, !5
         87        BOOL                                             ~77     ~78
         88    > > JMPNZ                                                    ~77, ->70
   39    89    >   IS_EQUAL                                                 !12, !5
         90      > JMPZ                                                     ~79, ->98
   40    91    >   INIT_FCALL_BY_NAME                                       'imagesetpixel'
         92        SEND_VAR_EX                                              !8
         93        SEND_VAR_EX                                              !15
         94        SEND_VAR_EX                                              !16
         95        SEND_VAR_EX                                              !10
         96        DO_FCALL                                      0          
         97      > JMP                                                      ->106
   42    98    >   INIT_FCALL_BY_NAME                                       'imagesetpixel'
         99        SEND_VAR_EX                                              !8
        100        SEND_VAR_EX                                              !15
        101        SEND_VAR_EX                                              !16
        102        CHECK_FUNC_ARG                                           
        103        FETCH_DIM_FUNC_ARG                               $81     !13, !12
        104        SEND_FUNC_ARG                                            $81
        105        DO_FCALL                                      0          
   25   106    >   PRE_INC                                                  !16
        107    >   IS_SMALLER                                               !16, !7
        108      > JMPNZ                                                    ~84, ->61
   24   109    >   PRE_INC                                                  !15
        110    >   IS_SMALLER                                               !15, !6
        111      > JMPNZ                                                    ~86, ->59
   46   112    >   INIT_FCALL                                               'round'
        113        INIT_FCALL                                               'microtime'
        114        SEND_VAL                                                 <true>
        115        DO_ICALL                                         $87     
        116        SUB                                              ~88     $87, !14
        117        SEND_VAL                                                 ~88
        118        SEND_VAL                                                 3
        119        DO_ICALL                                         $89     
        120        ASSIGN                                                   !22, $89
   48   121        INIT_FCALL_BY_NAME                                       'imagestring'
        122        SEND_VAR_EX                                              !8
        123        SEND_VAL_EX                                              3
        124        SEND_VAL_EX                                              1
        125        SEND_VAL_EX                                              1
        126        SEND_VAR_EX                                              !22
        127        SEND_VAR_EX                                              !9
        128        DO_FCALL                                      0          
   50   129        INIT_FCALL                                               'header'
        130        SEND_VAL                                                 'Content-type%3A+image%2Fpng'
        131        DO_ICALL                                                 
   51   132        INIT_FCALL_BY_NAME                                       'imagepng'
        133        SEND_VAR_EX                                              !8
        134        DO_FCALL                                      0          
        135      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.13 ms | 1408 KiB | 19 Q