phing icon indicating copy to clipboard operation
phing copied to clipboard

Change in behavior from v2 to v3 when overriding property for phingcall

Open mpanitz opened this issue 2 months ago • 0 comments

Describe the bug We recently migrated from Phing 2 to Phing 3.

We encountered a change in behavior when overriding properties for phingcalls, that we could not find in the changelog, the upgrade guide or the task documentation. But maybe we are simply missing something.

In Phing 2 we were able to define a property via CLI that was used in a phing target and then override this property for a specific <phingcall> to that target. In Phing 3 this does not work anymore and it causes trouble for our CI pipelines. So far I was not able to find a solution to that issue.

Steps To Reproduce Without providing our real world example that is a lot larger, this example covers the issue we are having:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Some project" default="something">

    <target name="something">
        <phingcall target="something_else" />
        <phingcall target="something_else">
            <property name="SOME_PROPERTY" value="${ANOTHER_PROPERTY}" override="true" />
        </phingcall>
    </target>

    <target name="something_else">
        <echo message="${SOME_PROPERTY}" />
    </target>
</project>

We are calling: phing -DSOME_PROPERTY=A -DANOTHER_PROPERTY=B

Expected behavior The output I expect, is what we are getting with Phing 2:

Some project > something:
Some project > something_else:
     [echo] A
Some project > something_else:
     [echo] B
BUILD FINISHED

Screenshots / terminal output With Phing 3 we are getting the following though:

Some project > something:
Some project > something_else:
     [echo] A
Some project > something_else:
     [echo] A
BUILD FINISHED

So the override of the property for that specific call simply does not work.

Additional context If I define SOME_PROPERTY not via CLI, but instead inside the phing project, it works. Like the following:

<project name="Some project" default="something">

    <property name="SOME_PROPERTY" value="A" />

    <target name="something">
        <phingcall target="something_else" />
        <phingcall target="something_else">
            <property name="SOME_PROPERTY" value="${ANOTHER_PROPERTY}" override="true" />
        </phingcall>
    </target>

We are running Phing 3.1.0 in PHP 8.3 as well as 8.4 (depending on the project)

Any help would be appreciated. If this is not a bug but intended behavior, I would be grateful for any pointers as to how we might be able to resolve this.

Thank you for your help

mpanitz avatar Nov 06 '25 16:11 mpanitz