Predefined constants don't work in static expressions

General discussion on Zend Guard / Optimizer

Predefined constants don't work in static expressions

Postby mikh1250 on Tue Feb 14, 2017 9:20 pm

Hello,

Static initialization expressions using predefined constants like __FILE__ and __DIR__ produce garbled results.
The bug occurrs with php 5.6 + zend guard 7 + debian 8 x64_86, but I think the version does not matter much.

To reproduce create a file - test.php
Code: Select all
<?php
class Foo { public static $expr = __DIR__ . '-bar'; }
var_dump(Foo::$expr);


Encode it with the cli tool:
Code: Select all
zendenc56 test.php test.enc.php


There should be no difference:
Code: Select all
diff -s <(php test.php) <(php test.enc.php)

yet, the php test.enc.php returns garbled string
Code: Select all
"\x00x00__DIR__sTr\x00\x00-bar"


Thanks
mikh1250
 
Posts: 1
Joined: Tue Feb 14, 2017 8:57 pm

Return to Zend Guard / Optimizer

Who is online

Users browsing this forum: No registered users and 3 guests