需要从deb包中提取某个目录,例如/usr/share
,必须通过管道完成,也就是说,wget -qO - http://.../package.deb | ar x data.tar.xz ...
我不知何故查看了不同的命令及其选项,但没有通过a解决这个问题管道,而不将文件保存到磁盘。
Віталій Карпенко's questions
包的名称需要它来获取下载的 URL,我找到了这个选项:
apt-get install --reinstall --print-uris -qq $package | cut -d"'" -f2 | grep "/$package_"
该选项非常有效,但是很慢,大约需要0.8秒才能获取1个URL,并且我需要获取数万个包的URL,因此需要一个更快的选项。
在使用 FS 时,我发现 PATH_MAX 宏实际上不起作用,即目录的完整路径不适合 PATH_MAX 大小的缓冲区。
我决定使用脚本来确定绝对路径的最大可能长度,我得到了 ~130791(这大约是我系统上的 PATH_MAX 的 32 倍)字符,然后 shell shell dash 停止运行任何程序并创建目录变得不可能,但显然这只是外壳本身的问题,没有限制。
如果实际上似乎没有限制,我想知道为什么需要这个宏?
我使用autoconf和automake,Makefile.am中有2个程序bin_PROGRAMS = game dedicated
如何分别构建?例如,我只需要收集专用的
我将此设备连接到带有 Debian buster / sid(目前是 Debian 测试)的 PC,安装了驱动程序(mt7601u)和 wirmware aptitude intsall firmware-misc-nonfree firmware-realtek
,但无法连接到接入点,它们的列表可用,但连接确实不会发生。
结论lsusb | grep 7601
:
Bus 001 Device 013: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
结论uname -r
:
4.12.0-1-amd64
部分输出lshw -C network
:
*-network:0
description: Wireless interface
physical id: 2
bus info: usb@1:10
logical name: wlxd46e0e1f1528
serial: 22:f9:ff:11:96:7c
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=mt7601u driverversion=4.12.0-1-amd64 firmware=N/A link=no multicast=yes wireless=IEEE 802.11
结论lsmod
:
Module Size Used by
rndis_host 16384 0
cdc_ether 16384 1 rndis_host
usbnet 45056 2 rndis_host,cdc_ether
nls_utf8 16384 0
isofs 40960 0
uas 24576 0
usb_storage 69632 1 uas
bnep 20480 2
fuse 98304 3
nls_ascii 16384 1
nls_cp437 20480 1
vfat 20480 1
fat 65536 1 vfat
arc4 16384 2
mt7601u 102400 0
mac80211 659456 1 mt7601u
cfg80211 593920 2 mac80211,mt7601u
joydev 20480 0
eeepc_wmi 16384 0
mxm_wmi 16384 0
asus_wmi 28672 1 eeepc_wmi
sparse_keymap 16384 1 asus_wmi
evdev 24576 13
serio_raw 16384 0
intel_rapl 20480 0
x86_pkg_temp_thermal 16384 0
hci_uart 98304 0
intel_powerclamp 16384 0
btbcm 16384 1 hci_uart
coretemp 16384 0
btqca 16384 1 hci_uart
btintel 16384 1 hci_uart
bluetooth 540672 11 hci_uart,btintel,btqca,bnep,btbcm
kvm_intel 196608 0
snd_hda_codec_hdmi 49152 1
ecdh_generic 24576 1 bluetooth
kvm 577536 1 kvm_intel
irqbypass 16384 1 kvm
crct10dif_pclmul 16384 0
crc32_pclmul 16384 0
ghash_clmulni_intel 16384 0
intel_cstate 16384 0
intel_uncore 118784 0
pcspkr 16384 0
intel_rapl_perf 16384 0
efi_pstore 16384 0
iTCO_wdt 16384 0
snd_hda_codec_realtek 90112 1
snd_hda_codec_generic 69632 1 snd_hda_codec_realtek
efivars 20480 1 efi_pstore
battery 20480 0
iTCO_vendor_support 16384 1 iTCO_wdt
intel_lpss_acpi 16384 0
intel_lpss 16384 1 intel_lpss_acpi
mfd_core 16384 1 intel_lpss
sg 32768 0
rfkill 24576 6 asus_wmi,bluetooth,cfg80211
wmi 16384 2 asus_wmi,mxm_wmi
snd_hda_intel 40960 3
snd_hda_codec 126976 4 snd_hda_intel,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
acpi_pad 24576 0
snd_hda_core 77824 5 snd_hda_intel,snd_hda_codec,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 102400 4 snd_hda_intel,snd_hda_codec,snd_hda_core,snd_hda_codec_hdmi
snd_timer 32768 1 snd_pcm
i915 1269760 21
shpchp 36864 0
mei_me 40960 0
snd 77824 14 snd_hda_intel,snd_hwdep,snd_hda_codec,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec_realtek,snd_pcm
soundcore 16384 1 snd
mei 94208 1 mei_me
video 40960 2 asus_wmi,i915
button 16384 1 i915
drm_kms_helper 151552 1 i915
drm 348160 6 i915,drm_kms_helper
i2c_algo_bit 16384 1 i915
acpi_als 16384 0
kfifo_buf 16384 1 acpi_als
industrialio 65536 2 acpi_als,kfifo_buf
parport_pc 28672 0
ppdev 20480 0
lp 20480 0
parport 49152 3 lp,parport_pc,ppdev
efivarfs 16384 1
ip_tables 24576 0
x_tables 36864 1 ip_tables
autofs4 40960 2
ext4 593920 2
crc16 16384 2 bluetooth,ext4
jbd2 102400 1 ext4
crc32c_generic 16384 0
fscrypto 28672 1 ext4
ecb 16384 0
mbcache 16384 1 ext4
dm_mod 114688 9
hid_generic 16384 0
usbhid 49152 0
sd_mod 49152 3
crc32c_intel 24576 4
aesni_intel 167936 0
aes_x86_64 20480 1 aesni_intel
crypto_simd 16384 1 aesni_intel
cryptd 24576 3 crypto_simd,ghash_clmulni_intel,aesni_intel
glue_helper 16384 1 aesni_intel
psmouse 143360 0
ahci 36864 2
libahci 32768 1 ahci
i2c_i801 24576 0
r8169 81920 0
mii 16384 2 r8169,usbnet
libata 233472 2 ahci,libahci
scsi_mod 212992 5 sd_mod,usb_storage,libata,uas,sg
xhci_pci 16384 0
xhci_hcd 208896 1 xhci_pci
usbcore 245760 9 rndis_host,usbnet,usbhid,usb_storage,mt7601u,cdc_ether,xhci_pci,uas,xhci_hcd
usb_common 16384 1 usbcore
fan 16384 0
thermal 20480 0
i2c_hid 20480 0
hid 118784 3 i2c_hid,hid_generic,usbhid
结论dmesg | grep 7601
:
[ 2.064050] usb 1-10: New USB device found, idVendor=148f, idProduct=7601
[ 9.675851] mt7601u 1-10:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 9.699453] mt7601u 1-10:1.0: Warning: unsupported EEPROM version 0d
[ 9.699454] mt7601u 1-10:1.0: EEPROM ver:0d fae:00
[ 9.699700] mt7601u 1-10:1.0: EEPROM country region 01 (channels 1-13)
[ 9.956146] usbcore: registered new interface driver mt7601u
[ 10.299466] mt7601u 1-10:1.0 wlxd46e0e1f1528: renamed from wlan0
[ 671.837363] mt7601u: disagrees about version of symbol module_layout
[ 678.803132] mt7601u: disagrees about version of symbol module_layout
[ 1827.135678] mt7601u 1-10:1.0: Error: MCU response pre-completed!
[ 1827.150595] mt7601u 1-10:1.0: Warning: unsupported EEPROM version 0d
[ 1827.150598] mt7601u 1-10:1.0: EEPROM ver:0d fae:00
[ 1827.150842] mt7601u 1-10:1.0: EEPROM country region 01 (channels 1-13)
[ 2209.540804] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.540855] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.540887] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.540967] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541006] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541087] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541126] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541207] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541285] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541365] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.541446] mt7601u 1-10:1.0: Error: RX urb failed:-71
[ 2209.555877] mt7601u 1-10:1.0: Warning: TX DMA did not stop!
[ 2213.559746] mt7601u 1-10:1.0: Warning: MAC TX did not stop!
[ 2215.963724] mt7601u 1-10:1.0: Warning: MAC RX did not stop!
[ 2215.963727] mt7601u 1-10:1.0: Warning: RX DMA did not stop!
[ 3387.319280] usb 1-10: New USB device found, idVendor=148f, idProduct=7601
[ 3387.579480] mt7601u 1-10:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 3387.605496] mt7601u 1-10:1.0: firmware: direct-loading firmware mt7601u.bin
[ 3387.605506] mt7601u 1-10:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
[ 3388.023844] mt7601u 1-10:1.0: Warning: unsupported EEPROM version 0d
[ 3388.023848] mt7601u 1-10:1.0: EEPROM ver:0d fae:00
[ 3388.024065] mt7601u 1-10:1.0: EEPROM country region 01 (channels 1-13)
[ 3388.244465] mt7601u 1-10:1.0 wlxd46e0e1f1528: renamed from wlan0
systemctl -u NetworkManager
尝试连接到接入点后的输出:
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4181] device (wlxd46e0e1f1528): Activation: starting connection 'mywifi' (5e961d46-56a6-48ff-ad6d-6e494f4d27e9)
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4190] audit: op="connection-activate" uuid="5e961d46-56a6-48ff-ad6d-6e494f4d27e9" name="mywifi" pid=958 uid=1000 result="success"
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4191] device (wlxd46e0e1f1528): state change: disconnected -> prepare (reason 'none', internal state 'managed')
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4192] manager: NetworkManager state is now CONNECTING
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4233] device (wlxd46e0e1f1528): set-hw-addr: reset MAC address to D4:6E:0E:1F:15:28 (preserve)
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4419] device (wlxd46e0e1f1528): state change: prepare -> config (reason 'none', internal state 'managed')
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4420] device (wlxd46e0e1f1528): Activation: (wifi) access point 'mywifi' has security, but secrets are required.
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4420] device (wlxd46e0e1f1528): state change: config -> need-auth (reason 'none', internal state 'managed')
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4530] device (wlxd46e0e1f1528): state change: need-auth -> prepare (reason 'none', internal state 'managed')
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4544] device (wlxd46e0e1f1528): state change: prepare -> config (reason 'none', internal state 'managed')
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4550] device (wlxd46e0e1f1528): Activation: (wifi) connection 'mywifi' has security, and secrets exist. No new secrets needed.
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4553] Config: added 'ssid' value 'mywifi'
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4555] Config: added 'scan_ssid' value '1'
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4557] Config: added 'key_mgmt' value 'WPA-PSK'
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4559] Config: added 'psk' value '<hidden>'
вер 14 13:46:10 myuser NetworkManager[1495]: <info> [1505385970.4688] device (wlxd46e0e1f1528): supplicant interface state: inactive -> scanning
вер 14 13:46:11 myuser NetworkManager[1495]: <info> [1505385971.4945] device (wlxd46e0e1f1528): supplicant interface state: scanning -> authenticating
вер 14 13:46:16 myuser NetworkManager[1495]: <info> [1505385976.5156] device (wlxd46e0e1f1528): supplicant interface state: authenticating -> disconnected
вер 14 13:46:16 myuser NetworkManager[1495]: <info> [1505385976.6157] device (wlxd46e0e1f1528): supplicant interface state: disconnected -> scanning
вер 14 13:46:17 myuser NetworkManager[1495]: <info> [1505385977.6402] device (wlxd46e0e1f1528): supplicant interface state: scanning -> authenticating
вер 14 13:46:22 myuser NetworkManager[1495]: <info> [1505385982.6634] device (wlxd46e0e1f1528): supplicant interface state: authenticating -> disconnected
вер 14 13:46:23 myuser NetworkManager[1495]: <info> [1505385983.1639] device (wlxd46e0e1f1528): supplicant interface state: disconnected -> scanning
вер 14 13:46:24 myuser NetworkManager[1495]: <info> [1505385984.1800] device (wlxd46e0e1f1528): supplicant interface state: scanning -> authenticating
вер 14 13:46:29 myuser NetworkManager[1495]: <info> [1505385989.2072] device (wlxd46e0e1f1528): supplicant interface state: authenticating -> disconnected
вер 14 13:46:30 myuser NetworkManager[1495]: <info> [1505385990.2083] device (wlxd46e0e1f1528): supplicant interface state: disconnected -> scanning
вер 14 13:46:31 myuser NetworkManager[1495]: <info> [1505385991.2365] device (wlxd46e0e1f1528): supplicant interface state: scanning -> authenticating
вер 14 13:46:36 myuser NetworkManager[1495]: <warn> [1505385996.1975] device (wlxd46e0e1f1528): Activation: (wifi) association took too long, failing activation
вер 14 13:46:36 myuser NetworkManager[1495]: <info> [1505385996.1976] device (wlxd46e0e1f1528): state change: config -> failed (reason 'ssid-not-found', internal state 'managed')
вер 14 13:46:36 myuser NetworkManager[1495]: <info> [1505385996.1980] manager: NetworkManager state is now DISCONNECTED
вер 14 13:46:36 myuser NetworkManager[1495]: <warn> [1505385996.2012] device (wlxd46e0e1f1528): Activation: failed for connection 'mywifi'
вер 14 13:46:36 myuser NetworkManager[1495]: <info> [1505385996.2022] device (wlxd46e0e1f1528): state change: failed -> disconnected (reason 'none', internal state 'managed')
вер 14 13:46:36 myuser NetworkManager[1495]: <info> [1505385996.2229] device (wlxd46e0e1f1528): set-hw-addr: set MAC address to 56:E5:39:FA:59:DC (scanning)
вер 14 13:46:36 myuser NetworkManager[1495]: <warn> [1505385996.2611] sup-iface[0x7f48440020a0,wlxd46e0e1f1528]: connection disconnected (reason -3)
вер 14 13:46:36 myuser NetworkManager[1495]: <info> [1505385996.2613] device (wlxd46e0e1f1528): supplicant interface state: authenticating -> disconnected
dmesg
尝试连接到接入点后的输出:
[ 4695.971702] IPv6: ADDRCONF(NETDEV_UP): wlxd46e0e1f1528: link is not ready
[ 4696.986767] wlxd46e0e1f1528: authenticate with 94:0c:6d:f7:66:b4
[ 4697.015761] wlxd46e0e1f1528: send auth to 94:0c:6d:f7:66:b4 (try 1/3)
[ 4697.017342] wlxd46e0e1f1528: authenticated
[ 4702.018559] wlxd46e0e1f1528: aborting authentication with 94:0c:6d:f7:66:b4 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4714.018624] wlxd46e0e1f1528: authenticate with 94:0c:6d:f7:66:b4
[ 4714.048511] wlxd46e0e1f1528: send auth to 94:0c:6d:f7:66:b4 (try 1/3)
[ 4714.052990] wlxd46e0e1f1528: authenticated
[ 4719.049890] wlxd46e0e1f1528: aborting authentication with 94:0c:6d:f7:66:b4 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 4721.154356] IPv6: ADDRCONF(NETDEV_UP): wlxd46e0e1f1528: link is not ready
[ 4721.175754] IPv6: ADDRCONF(NETDEV_UP): wlxd46e0e1f1528: link is not ready
设置区域iw reg get
:
global
country UA: DFS-ETSI
(2400 - 2483 @ 40), (N/A, 20), (N/A), NO-OUTDOOR
(5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
(5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
(5490 - 5670 @ 160), (N/A, 20), (0 ms), DFS
(5735 - 5835 @ 80), (N/A, 20), (N/A)
(57000 - 66000 @ 2160), (N/A, 40), (N/A)
我还尝试在 NetworkManager GUI 中禁用 IPV6,但没有帮助。
我还从 USB 闪存驱动器启动到 Linux Mint 和 Ubuntu,一切正常。
如何使适配器在 Debian 中工作?
我制作了一个简单的 shell 脚本来对所有已安装的软件包进行排序并删除不需要的软件包:
#!/bin/sh
pkgs=`dpkg --get-selections | awk '{ print $1 }' | cut -f1 -d :`
echo "$pkgs" | while IFS='' read -r line || [ -n "$line" ]; do
apt purge "$line"
done
但是当 shell 解释器调用apt purge "$line"
apt 时,它会停止并显示“Abort”消息。由于缺少交互式输入:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
sysvinit-core
The following packages will be REMOVED:
acl* systemd* systemd-sysv*
The following NEW packages will be installed:
sysvinit-core
0 upgraded, 1 newly installed, 3 to remove and 0 not upgraded.
Need to get 132 kB of archives.
After this operation, 12.2 MB disk space will be freed.
Do you want to continue? [Y/n] Abort.
如何apt purge "$line"
在执行时将输入传递给启动时的子进程?
我不得不将一个分支合并到另一个分支中。合并在一个文件中发现了冲突。解决后,我以错误的方式编辑了文件。如何撤消对文件的更改?
为了使其在合并尝试后成为正确的方式,我尝试这样做
git checkout myfile.c
他收到了答复
错误:路径“myfile.c”未合并
其余的我没有尝试,以免误伤。
有数据库,里面有表,表里有行,一切如常。
该表有一列time
类型Integer
我们需要找出表中所有行中时间字段的最唯一值。
例如,表中有 3 行,其中两行的时间等于 2,第三行的时间等于 3,两行的时间为 - 2,一行的时间为 - 3,结果 3 是最唯一的数字(最少使用)在所有行中,什么 SQL 查询可以找到这个数字?
有必要编译破折号,从这里下载源代码http://git.kernel.org/cgit/utils/dash/dash.git
我在存储库目录中执行它./configure --help
,但configure
事实证明没有文件,存储库根目录中有以下文件和目录:autogen.sh ChangeLog.O COPYING src ChangeLog configure.ac Makefile.am
而且src
是的,Makefile.am
我知道我需要以某种方式configure
使用 Automake生成
如何做?
有一个变量struct tm *time
,如何以人类可读的形式准确、简单地显示从存储在另一个变量 ( struct tm *stime
) 中的日期到该日期之前还剩多少?
有几个 LXC 容器,LVM 逻辑卷用作 rootfs 的存储。
我希望所有容器都有一个安装在 /mnt/shared 中的公共 LVM 逻辑卷,所有容器都可以在其中写入/读取。
我怎样才能做到这一点?
半个小时我被Debian sid仓库的OpenDKIM(包名小写)折磨了半个小时,
他不想听他的默认tcp端口,他在config里指定了,但他还是听unix插座。
在 htop 中,我注意到守护进程以选项开头-p local:/var/run/opendkim/opendkim.sock
,我查看了它的 systemd 单元并确实在那里找到了ExecStart
选项-p local:/var/run/opendkim/opendkim.sock
,正如你可能猜到的那样,这个选项表明你需要监听指定的 unix 套接字,在我看来不是是的,它破坏了与旧版本的兼容性,甚至不符合 的说明wiki.debian.org
,说明并不像我认为的那么旧https://wiki.debian.org/opendkim
与这些相关的有几个问题:
1.在哪里转?包说明里有maintainer的邮箱,需要写邮件给他吗?
2. 包中某处是否有每个更改的描述,即我可以找到解释为什么将此参数添加到单元脚本的注释吗?
3. 我应该报告这个“错误”吗?毕竟,这个论点可能是由比我更精通的人添加的,我不想与他争论,但通过谷歌翻译更是如此
我开始研究 Doctrine 2 并将 sql 查询转换为对 EntityManager 的查询,$this->em->getRepository(...)->...
但我无法转换一个查询:
SELECT * FROM mytable ORDER BY (a - b - c) DESC LIMIT :offset, :rows
a、b、c - mytable 表中的字段。
到处都只给出了如何根据两个数字的差异进行排序的示例,但我无法理解如何根据三个数字的差异进行排序。
如何将此请求更改为对 EntityManager 的请求?
我决定查看不同的桌面环境,将 KDE 设置为启动(禁用 aptitude 设置中的设置建议)(aptitude install kde-plasma-desktop kwin-x11
),查看并删除(aptitude purge kde-plasma-desktop kwin-x11
),并且dpkg --purge $(dpkg --get-selections | grep deinstall | cut -f1)
由于某种原因未删除配置也这样做了,之后系统好像又回到了安装前的状态(除了~/里面的隐藏目录没有被删除),我开始安装gnome(aptitude install gnome
),查了一下,用同样的方法删除了(aptitude purge gnome
同时dpkg --purge $(dpkg --get-selections | grep deinstall | cut -f1)
我仍然有一堆恶魔在工作,每 GB 的空间比安装前少,为什么?
有一个函数指针结构:
typedef struct
{
int (*pfnVidInit)();
....
} UI_FUNCTIONS;
我需要创建并填充此结构的实例。在 C 中,我只是输入函数的名称:
static UI_FUNCTIONS gMenuFuncs = {
Menu_VideoInit,
...
};
现在我决定尝试用 C++ 重新制作我的菜单:
static UI_FUNCTIONS gMenuFuncs = {
Menu::getInstance()->VideoInit,
...
};
但编译器写道,它不能导致int (Menu::)()
Why int (*)()
is there (Menu::)
, and not (*)
, and how can I do it (*)
?
有两个设置范围的数字,你需要对循环中的每个数字做一些事情,但不是按循环顺序,而是随机顺序。
范围显然是未知的并且很大,所以复杂度和内存消耗是 O(1)。
为此可以使用哪些算法/模式?
class A {
public function foo() {
echo 'ok';
}
}
class B {
protected $var;
public function __construct(A $a) {
$this->var = $a;
}
}
class C extends B {
public function __invoke() {
$this->var->foo();
}
}
$var = new C(new A);
$var();
我得到:
PHP Notice: Undefined property: C::$var in /var/www/.../q.php on line 17
PHP Fatal error: Uncaught Error: Call to a member function foo() on null in /var/www/.../q.php:17
Stack trace:
#0 /var/www/.../q.php(22): C->__invoke()
#1 {main}
thrown in /var/www/.../q.php on line 17
早些时候,当 C 和 B 是一个班级时,一切正常。
到这里我明白了不仅没有调用构造函数,连$var都没有被继承,为什么呢?