{
 "article": "/articles/php-8-5-13-8-6-0-jit-makes-mandelbrot-92-6-faster-31bc2ad7/",
 "lab": {
  "checks": [],
  "claims": [
   {
    "quote": "Improve performance error position tracking during JSON decoding.",
    "results": [
     "JSON encode and decode, 20,000 arrays"
    ],
    "url": "https://www.php.net/ChangeLog-8.php#8.6.0",
    "verdict": "not visible"
   }
  ],
  "commands": [
   "cat php-core.php | docker run --rm -i --network none --read-only --user 10001:10001 --tmpfs /tmp:exec php:8.6.0-cli php",
   "For 8.6.0 JIT on add -d opcache.enable_cli=1 -d opcache.jit=tracing -d opcache.jit_buffer_size=64M -d opcache.file_update_protection=0 right after php.",
   "For 8.5.13 use php:8.5.13-cli.",
   "The script: https://thestacksentinel.com/lab/scripts/php-core.php.txt (save it as php-core.php)",
   "Defaults: the same command with https://thestacksentinel.com/lab/scripts/php-defaults.php.txt prints every DEFAULT line"
  ],
  "date": "2026-11-23",
  "defaults": {
   "about": "ini directives at their built-in defaults and the extensions the image loads",
   "added": [
    {
     "name": "ini:error_include_args",
     "new": "0"
    }
   ],
   "changed": [
    {
     "name": "ini:include_path",
     "new": ".:",
     "old": ".:/usr/local/lib/php"
    },
    {
     "name": "ini:session.cookie_httponly",
     "new": "1",
     "old": "0"
    },
    {
     "name": "ini:session.cookie_samesite",
     "new": "Lax",
     "old": ""
    },
    {
     "name": "ini:session.use_strict_mode",
     "new": "1",
     "old": "0"
    }
   ],
   "compared": 267,
   "counts": {
    "added": 1,
    "changed": 4,
    "removed": 13
   },
   "new": "8.6.0",
   "old": "8.5.13",
   "removed": [
    {
     "name": "extension:mbstring",
     "old": "loaded"
    },
    {
     "name": "ini:mbstring.detect_order",
     "old": ""
    },
    {
     "name": "ini:mbstring.encoding_translation",
     "old": "0"
    },
    {
     "name": "ini:mbstring.http_input",
     "old": ""
    },
    {
     "name": "ini:mbstring.http_output",
     "old": ""
    },
    {
     "name": "ini:mbstring.http_output_conv_mimetypes",
     "old": "^(text/|application/xhtml\\+xml)"
    },
    {
     "name": "ini:mbstring.internal_encoding",
     "old": ""
    },
    {
     "name": "ini:mbstring.language",
     "old": "neutral"
    },
    {
     "name": "ini:mbstring.regex_retry_limit",
     "old": "1000000"
    },
    {
     "name": "ini:mbstring.regex_stack_limit",
     "old": "100000"
    },
    {
     "name": "ini:mbstring.strict_detection",
     "old": "0"
    },
    {
     "name": "ini:mbstring.substitute_character",
     "old": ""
    },
    {
     "name": "ini:zend.signal_check",
     "old": "0"
    }
   ]
  },
  "family": "runtime",
  "findings": [
   {
    "kind": "claim",
    "text": "Release notes: \"Improve performance error position tracking during JSON decoding.\" - not visible on our machine"
   },
   {
    "kind": "default",
    "text": "Default changed: ini:include_path is .: in 8.6.0, .:/usr/local/lib/php in 8.5.13"
   },
   {
    "kind": "default",
    "text": "Default changed: ini:session.cookie_httponly is 1 in 8.6.0, 0 in 8.5.13"
   },
   {
    "kind": "default",
    "text": "2 more defaults differ between 8.5.13 and 8.6.0"
   },
   {
    "kind": "default",
    "text": "Gone in 8.6.0, present in 8.5.13: extension:mbstring, ini:mbstring.detect_order, ini:mbstring.encoding_translation and 10 more"
   },
   {
    "kind": "difference",
    "text": "Mandelbrot set in plain PHP, JIT on against the default: 8.6.0 JIT on is 92.6% faster than 8.6.0"
   },
   {
    "kind": "difference",
    "text": "String building and splitting, JIT on against the default: 8.6.0 JIT on is 11.2% faster than 8.6.0"
   }
  ],
  "limits": [
   "One machine: an 8-core desktop CPU under Windows 11 and WSL 2; a Linux server may behave differently.",
   "Small kernels, not an application: real sites spend their time in I/O, frameworks and OPcache-warmed code."
  ],
  "method": [
   "Median of 11 rounds after 1 warm-up round; the version that starts each round rotates",
   "One process per round in each container: one warm-up call, then one timed call per workload",
   "Small single-threaded kernels without OPcache, as the CLI runs them by default; nothing is read from or written to disk",
   "JIT on: OPcache for the CLI with the tracing JIT and a 64 MB buffer, set by php's own -d flags; the script reports JIT on only after the JIT has compiled code",
   "JIT as each version runs it: off on 8.5.13, off on 8.6.0, on on 8.6.0 JIT on"
  ],
  "product": "PHP",
  "question": "What changes when you upgrade PHP 8.5.13 to 8.6.0, and what changes with JIT on?",
  "results": [
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 6.857142857142863,
    "kind": "speed",
    "name": "Start-up",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 0.175,
      "spread_pct": 1.4
     },
     "8.6.0": {
      "median": 0.187,
      "spread_pct": 11.2
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 0.3287671232876837,
    "kind": "speed",
    "name": "JSON encode and decode, 20,000 arrays",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 69.35,
      "spread_pct": 5.3
     },
     "8.6.0": {
      "median": 69.578,
      "spread_pct": 1.5
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": -2.592980618124678,
    "kind": "speed",
    "name": "Regular expressions",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 3.818,
      "spread_pct": 3.2
     },
     "8.6.0": {
      "median": 3.719,
      "spread_pct": 2.4
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": -0.9048019130097626,
    "kind": "speed",
    "name": "SHA-256 of 32 MB",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 15.473,
      "spread_pct": 3.5
     },
     "8.6.0": {
      "median": 15.333,
      "spread_pct": 3.2
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 2.6794493608652896,
    "kind": "speed",
    "name": "Sort 300,000 numbers",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 48.816,
      "spread_pct": 1.5
     },
     "8.6.0": {
      "median": 50.124,
      "spread_pct": 2.3
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 2.762820847927218,
    "kind": "speed",
    "name": "Array with 300,000 keys",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 38.258,
      "spread_pct": 2.6
     },
     "8.6.0": {
      "median": 39.315,
      "spread_pct": 3.3
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 4.2084666273255165,
    "kind": "speed",
    "name": "String building and splitting",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 32.197,
      "spread_pct": 2.4
     },
     "8.6.0": {
      "median": 33.552,
      "spread_pct": 4.2
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": 6.095412021017557,
    "kind": "speed",
    "name": "Mandelbrot set in plain PHP",
    "unit": "ms",
    "values": {
     "8.5.13": {
      "median": 62.424,
      "spread_pct": 1.1
     },
     "8.6.0": {
      "median": 66.229,
      "spread_pct": 1.3
     }
    }
   },
   {
    "better": "lower",
    "clear": true,
    "delta_pct": -92.64068610427456,
    "kind": "speed",
    "name": "Mandelbrot set in plain PHP, JIT on against the default",
    "unit": "ms",
    "values": {
     "8.6.0": {
      "median": 66.229,
      "spread_pct": 1.3
     },
     "8.6.0 JIT on": {
      "median": 4.874,
      "spread_pct": 1.7
     }
    }
   },
   {
    "better": "lower",
    "clear": false,
    "delta_pct": -8.276739158082151,
    "kind": "speed",
    "name": "Array with 300,000 keys, JIT on against the default",
    "unit": "ms",
    "values": {
     "8.6.0": {
      "median": 39.315,
      "spread_pct": 3.3
     },
     "8.6.0 JIT on": {
      "median": 36.061,
      "spread_pct": 2.6
     }
    }
   },
   {
    "better": "lower",
    "clear": true,
    "delta_pct": -11.20946590367191,
    "kind": "speed",
    "name": "String building and splitting, JIT on against the default",
    "unit": "ms",
    "values": {
     "8.6.0": {
      "median": 33.552,
      "spread_pct": 4.2
     },
     "8.6.0 JIT on": {
      "median": 29.791,
      "spread_pct": 2.4
     }
    }
   }
  ],
  "rig": {
   "cpu": "AMD Ryzen 7 7800X3D (8 cores, 16 threads)",
   "docker": "Docker Engine 29.9.3",
   "driver": "",
   "gpu": "",
   "os": "Windows 11 Pro, Docker Desktop (WSL 2)",
   "ram": "32 GB"
  },
  "schema": 1,
  "self_test": {
   "clear": 0,
   "max_delta_pct": 2.2,
   "name": "8.5.13 against 8.5.13 in two containers"
  },
  "subjects": [
   {
    "digest": "sha256:f324fcb4dc009ac0470a7d614cd122499dcee3ca47a9bab620fc14c0eb759ba2",
    "image": "php:8.5.13-cli",
    "label": "8.5.13"
   },
   {
    "digest": "sha256:d84acf3155d907afaa5afa9b9457c5f12016b6dc7ade84659f40cdc505cc087d",
    "image": "php:8.6.0-cli",
    "label": "8.6.0"
   },
   {
    "digest": "sha256:d84acf3155d907afaa5afa9b9457c5f12016b6dc7ade84659f40cdc505cc087d",
    "image": "php:8.6.0-cli",
    "label": "8.6.0 JIT on"
   }
  ]
 }
}