Your tool is broken - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Your tool is broken.php

  1. <?php
  2.  
  3. $palette_size = 10;
  4.  
  5. $brighter_steps = 4;
  6.  
  7. $palette = [
  8.     '.50',
  9.     '.100',
  10.     '.200',
  11.     '.300',
  12.     '.400',
  13.     '.500',
  14.     '.600',
  15.     '.700',
  16.     '.800',
  17.     '.900',
  18. ];
  19.  
  20.         // Palette should be numbered to 1000
  21.         $step = round( 1000 / $palette_size );
  22.         $numbered_palette = [];
  23.         // We brightened the first brighter step by only half the other steps.
  24.         if ( 0 < $brighter_steps ) {
  25.                 $numbered_palette[ $step / 2 ] = array_shift( $palette );
  26.         }
  27.         for ( $i = $step; $i < 1000; $i += $step ) {
  28.                 $numbered_palette[ $i ] = array_shift( $palette );
  29.         }
  30.  
  31.  
  32. var_dump( $numbered_palette );
File Description
  • Your tool is broken
  • PHP Code
  • 23 Feb-2021
  • 589 Bytes
You can Share it: