fezfez / php-to-zephir

Convert PHP to Zephir
MIT License
191 stars 40 forks source link

Fatal error:: Cannot use 'PhpParser\Node\Expr\Cast\Bool' as class name as it is reserved #32

Open ganeshkbhat opened 8 years ago

ganeshkbhat commented 8 years ago

When compiling I am getting this error when converting:

Fatal error: Cannot use 'PhpParser\Node\Expr\Cast\Bool' as class name as it is reserved in C:\Users\ganes\Downloads\php\php-to-c\php-to-c-extension\vendor\fezfez\php-to-zephir\src\PhpToZephir\Converter\Printer\Expr\Cast\BoolPrinter.php on line 16

I am working with arrays and using unset function. Its a simple iterator

fezfez commented 8 years ago

Can you run the convertion with --debug and identify the code ?

ganeshkbhat commented 8 years ago

Fez, thats the error when I am running the --debug option as well. The command is this:

php bin/php-to-zephir.php phpToZephir:convert --debug C:\Users\ganes\Downloads\php\sample

ganeshkbhat commented 8 years ago

I must say I am on Windows 10. now i am getting the this error:

php vendor/bin/php-to-zephir phpToZephir:convert C:\Users\ganes\Downloads\php\sample\

dir=$(d=${0%[/\\]*}; cd "$d"; cd "../fezfez/php-to-zephir/bin" && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/php-to-zephir" "$@"
ganeshkbhat commented 8 years ago

i presume it was a bat file so the issue. i was using the command php vendor/bin/php-to-zipher.bat it breaks. if I use the path php vendor\fezfez\php-to-zephir\bin\php-to-zipher the compilation to zipher occurs correctly. i cannot run the .bat file directly though says not correct path. please check the bat file for path definition issues

ganeshkbhat commented 8 years ago

Not sure what I did. I set up the environment for Zephir and now the php vendor\fezfez\php-to-zephir\bin\php-to-zipher command also does not compile to zipher. I am able to compile .zep files to an complete .dll and .so. I am on Windows 10, PHP 7.0.4 TS X64, Apache 2.4. I have attached my environment variables and the errors.

env variables php2zipher