Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Vaisseau spatial toujours faux

By Jerome Tamarelle

<?php

class A {}
class B {}

$a = new A;
$b = new B;

var_dump($a <=> $b); // 1: A > B
var_dump($b <=> $a); // 1: B > A 
var_dump($b == $a);  // false

Comparer A à B, et A est plus grand que B.

Comparer B à A, et B est plus grand que A.

Et, au final, ils sont toujours différents.

See Also

PHP Features

Last updated: 11 October 2026