Skip to content

Instantly share code, notes, and snippets.

@jasny
Created June 26, 2019 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasny/eacd187c949459b70d8f8f0818411f0a to your computer and use it in GitHub Desktop.
Save jasny/eacd187c949459b70d8f8f0818411f0a to your computer and use it in GitHub Desktop.
Proof of concept where `strict_types` affects `==` and `!=` operators
<?php
var_dump("1" == 1);
var_dump("1" != 1);
<?php
declare(strict_types=1);
var_dump("1" == 1);
var_dump("1" != 1);
<?php
// Test for https://github.com/jasny/php-src/tree/strict_types-affect-operators-test
echo "== STANDARD ==\n";
include 'poc-standard.php';
echo "\n";
echo "== STRICT ==\n";
require 'poc-strict.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment