我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP默认参数,你可以挑选吗?

In C# you can pick and choose your parameters by name, like so:

public void Foo(int b = 0, int a = 1, int r = 2) {
    print(b + ", " + a + ", " r);
}

Foo( b: 1, r: 7 );

which would result in the numbers

1, 1, 7

being printed out, skipping the default variable "A".

I was wondering if this was possible in php, because passing the default value when you don't need to use it seems redundant.

近期文章

  • 退出CodeIgniter中自定义控制器类的执行以停止呈现视图
  • json_encode():参数中的UTF-8序列无效
  • PHP函数执行时的实时输出
  • 授予执行.c文件的权限
  • 为什么将依赖关系绑定到业务对象是错误的?
  • Paypal sandBox交易价值存储数据库?
  • 如何使用message_id从hMailServer检索消息?
  • 如果字符串中的变音符号/变异,PHP中的输出失败(无输出!)
  • 如何在Elastic Search-PHP [1.0]客户端中返回特定字段
  • 如何在Woocommerce产品中添加可选的浇头选项?
  • MongoDB登录表单不起作用
  • Laravel 5找不到驱动程序问题
  • 将整个MYSQL语句从android传递给PHP
  • 如何使用OAuth2实现登录API端点
  • 错误:间接修改重载属性
  • 未捕获的TypeError:无法读取未定义的属性“数据集”
  • 如何为所有网址设置curl_setopt以使用curl下载网址?
  • 用$ list(wordpress)中的斜杠分隔多个元值
  • 如何在codeigniter中使用ajax在mysql数据库中插入数据?
  • 从REST API处理客户端错误

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华