ircmaxell / php-compiler

A compiler. For PHP
MIT License
794 stars 33 forks source link

Add support for boolean negation #20

Closed driusan closed 5 years ago

driusan commented 5 years ago

This adds support for the TYPE_BOOLEAN_NOT opcode to the VM, allowing programs as complex as

<?php
$a = true;
$b = !$a;
echo $b ? "true" : "false";

to run. It also adds a test case in the test/compliance/cases directory, but I'm not entirely sure how to run those so I'm not entirely sure if it works.